I've never worked with screens or grid before on a channel, previous development has been on roImageCanvas. I have got the grid to load all of my data into categories correctly. The problem comes when I select a particular video to play. For some reason it only picks selections from Row 0. If I scroll across Row 0 and pick a video, it is correct, but if I move to say Row2 it still pricks the correct col but only from Row 0. I got the example code from the roku sdk online. Any help appreciated.
Thanks
m.port=CreateObject("roMessagePort")
screen = CreateObject("roGridScreen")
screen.SetMessagePort(m.port)
screen.SetDisplayMode("scale-to-fill")
shows=m.showlist
categoryList = getCategoryList()
screen.setupLists(categoryList.count())
screen.SetListNames(categoryList)
Print"NUMBER IN CATEGORYLIST. . ."categoryList.count()
for i = 0 to categoryList.count()-1
screen.SetContentList(i,getShowsForCategoryItem(categoryList,shows))
end for
screen.Show()
while true
msg = wait(0, m.port)
if type(msg) = "roGridScreenEvent" then
if msg.isScreenClosed() then
return -1
elseif msg.isListItemFocused()
print "Focused msg: ";msg.GetMessage();"row: ";msg.GetIndex();
print " col: ";msg.GetData()
elseif msg.isListItemSelected()
print "Selected msg: ";msg.GetMessage();"row: ";msg.GetIndex();
print " col: ";msg.GetData()
Print"CHANNEL NAME . . . . "m.showList[msg.GetData()].title
playcontent(m.showList[msg.GetData()].stream)
endif
endif
end while