code from simplegrid with minor edits
Function showGridScreen(screen As Object, gridstyle as string) As string
print "enter showGridScreen"
categoryList = getCategoryList()
categoryList[0] = "GridStyle: " + gridstyle
screen.setupLists(categoryList.count())
screen.SetListNames(categoryList)
StyleButtons = getGridControlButtons()
screen.SetContentList(0, StyleButtons)
screen.SetContentList(1, getShowsForCategoryItem(categoryList[1]))
screen.SetContentList(2, getShowsForCategoryItem(categoryList[2]))
screen.SetContentList(3, getShowsForCategoryItem(categoryList[3]))
screen.Show()
'set up flag variable for row visible/invisible
Flag=TRUE
'end of edit
while true
print "Waiting for message"
msg = wait(0, m.port)
print "Got Message:";type(msg)
if type(msg) = "roGridScreenEvent" then
print "msg= "; msg.GetMessage() " , index= "; msg.GetIndex(); " data= "; msg.getData()
if msg.isListItemFocused() then
print"list item focused | current show = "; msg.GetIndex()
else if msg.isListItemSelected() then
row = msg.GetIndex()
'spliced code
If row=0
If Flag=TRUE
Flag=FALSE
Print "Reality row visible = FALSE"
Else
Flag=TRUE
Print "Reality row visible = TRUE"
End If
screen.SetListVisible(1,Flag) ' toggle visiblility of "Reality row 1"
End If
'end of spliced code
selection = msg.getData()
print "list item selected row= "; row; " selection= "; selection
else if msg.isScreenClosed() then
return ""
end if
end If
end while
End Function