Your Digital Media Has Never Looked So Good

 
User avatar
scaper12123
Topic Author
Posts: 48
Joined: Thu Jun 23, 2016 6:54 am

missing message port problems

Tue Jun 28, 2016 1:28 pm

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.
 
User avatar
RokuJoel
Posts: 1758
Joined: Mon Nov 14, 2011 5:22 pm

Re: missing message port problems

Tue Jun 28, 2016 1:36 pm

You seem to be missing a

screen.setmessageport(port) 


Line.

- Joel
 
User avatar
RokuKC
Posts: 315
Joined: Wed Sep 10, 2014 10:44 am
Location: Roku HQ

Re: missing message port problems

Tue Jun 28, 2016 1:37 pm

Are you missing:
   screen.SetMessagePort(port)

?

Oops, Joel beat me to it. :D
 
User avatar
scaper12123
Topic Author
Posts: 48
Joined: Thu Jun 23, 2016 6:54 am

Re: missing message port problems

Tue Jun 28, 2016 1:39 pm

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.

Who is online

Users browsing this forum: No registered users and 4 guests