Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
scaper12123
Level 7

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.
I AM THE ARCHMAGE... who is also rather new to Brightscript so forgive me for seeming inept at times.
0 Kudos
3 Replies
Roku Employee
Roku Employee

Re: missing message port problems

You seem to be missing a

screen.setmessageport(port) 


Line.

- Joel
0 Kudos
Roku Employee
Roku Employee

Re: missing message port problems

Are you missing:

screen.SetMessagePort(port)

?

Oops, Joel beat me to it. Smiley Very Happy
0 Kudos
scaper12123
Level 7

Re: missing message port problems

"RokuJoel" wrote:
You seem to be missing a

screen.setmessageport(port) 


Line.

- Joel


ooooh! i'm completely silly! my bad.
I AM THE ARCHMAGE... who is also rather new to Brightscript so forgive me for seeming inept at times.
0 Kudos