Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
shadowing
Visitor

Clearing a GridScreen Row

I'm not sure if this was asked before, but is it possible to clear a GridScreen row that is already populated with content? I've tried setting the ContentList with an RoInvalid, or roArray with invalid roAssociativeArrays, but this doesn't seem to work at all.
0 Kudos
9 REPLIES 9
destruk
Binge Watcher

Re: Clearing a GridScreen Row

Setting the row with new data works.
0 Kudos
shadowing
Visitor

Re: Clearing a GridScreen Row

I tried doing that, but that just populates the row with the new content. I'm trying to find a way where I can make the row literally disappear.
0 Kudos
destruk
Binge Watcher

Re: Clearing a GridScreen Row

ah. ok. Have you tried SetListVisible (integer rowindex, boolean visible) - ie to make row #5 disappear that is screenhandle.SetListVisible(5,False) - with row 0 being the top row. You may need to ensure to set the focusedlistitem to a different row if the user is already on row 5 - I haven't tried making rows disappear and reappear before. Worst case is you destroy the gridscreen and create a new one.
0 Kudos
destruk
Binge Watcher

Re: Clearing a GridScreen Row

If neither of those options are workable, you 'could' do the removal 'manually' - by setting the bottom row visible=false, then setting the list name for the row you are removing to the name of the row below it. And setting the content of the row you are removing to any content in the row below it. and repeat til all the rows are effectively 'moved up' by one. One of the previous methods in the prior post would be a lot easier.
0 Kudos
shadowing
Visitor

Re: Clearing a GridScreen Row

What is SetListVisible supposed to exactly? I've tried using it, but it doesn't really clear the row that I use it on. Instead, the entries are still there, but i can't access it.
0 Kudos
shadowing
Visitor

Re: Clearing a GridScreen Row

I've been futzing around a lot more, but the only real solution that I got is kind of hacky. I have to recreate the GridScreen every time I want to 'clear' a row. It seems as if SetListVisible simply keeps the list being shown, but makes it impossible for the user to go to that specific list.
0 Kudos
destruk
Binge Watcher

Re: Clearing a GridScreen Row

I have been real busy with other projects, so I haven't had any chance to play with this.
It seems to work fine/as intended. Are you using the Roku1 or Roku2?
0 Kudos
destruk
Binge Watcher

Re: Clearing a GridScreen Row

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
0 Kudos
shadowing
Visitor

Re: Clearing a GridScreen Row

I've been using a Roku 2. I'm not sure if the behavior is different on the Roku 1 though.
0 Kudos