Forum Discussion

scaper12123's avatar
10 years ago

missing message port problems

i've run into a strange problem where my program is making no responses when running a particular screen, specifically a grid with several video listings. I've tried a few things to root out the problem but nothing seems to stick. Here is the code I have

sub CreateRecentMenu()
screen = CreateObject("roGridScreen")
port = CreateObject("roMessagePort")
xml = CreateObject("roXMLElement")
xml_str = CreateObject("roString")

link_str = "[url removed for privacy purposes]"

xml_str = GetXML_1(link_str)
json = ParseJson(xml_str)
recent = GetRecentSermons(json)

screen.SetGridStyle("flat-landscape")
screen.SetupLists(1) 'more lists will be added in the near future, but i am only using one row for now
screen.SetListNames("Recent Teachings")
screen.SetContentList(0, recent)

screen.show()

while(true)
msg = wait(0, port)
if(type(msg) = "roGridScreenEvent")
if msg.isListItemFocused()
print "focused " + recent[msg.GetData()].Title
else if msg.isListItemSelected()
print "selected " + recent[msg.GetData()].Title
else if msg.isScreenClosed()
print "closed Recent menu successfully"
return
end if
end if
end while

return
End sub


Again, i'm absolutely not sure what could be causing this issue i'm having. I've attempted to print out type(msg) several times to learn what type of event the screen is getting but it gives me nothing in response. Any thoughts would be appreciated.

3 Replies

  • You seem to be missing a

    screen.setmessageport(port) 


    Line.

    - Joel
  • RokuKC's avatar
    RokuKC
    Roku Employee
    Are you missing:

    screen.SetMessagePort(port)

    ?

    Oops, Joel beat me to it. 😄
  • "RokuJoel" wrote:
    You seem to be missing a

    screen.setmessageport(port) 


    Line.

    - Joel


    ooooh! i'm completely silly! my bad.