Roku Developer Program

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

roTextScreen button problem

I just created a TextScreen component with one button. The screen works fine, but the button cannot be accessed. The 4-way pad on the remote does nothing. The button is not active. Can anyone see any problems with my code?

Thanks - Kenny



screen = CreateObject("roTextScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)


details = aFunction(FN)
screen.SetText(details.description)
screen.AddButton(1, "Back")
screen.show()
dialog.Close()
while (true)
msg = wait(0, port)
if type(msg) = "roTextScreenEvent"
if msg.isScreenClosed()
exit while
else if msg.isButtonPressed()
exit while
endif
endif

end while
screen.Close()
0 Kudos
6 REPLIES 6\
TheEndless
Level 9

Re: roTextScreen button problem

Are you sure it's not crashing? Your code calls "dialog.Close()", but I don't see where you created "dialog".
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
calvaryftl
Level 7

Re: roTextScreen button problem

Oops. That line should not be there - I removed the dialog code when I posted here, just for clarity...
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: roTextScreen button problem

This looks like a bug. If your text is not long enough to make the vertical scrollbar appear, pressing DOWN won't focus the button. Pressing OK does focus the button, but that's not very intuitive. I'll make sure the right people are aware of the problem.

As a workaround, if your text is fairly short you might be able to use a roParagraphScreen instead.
0 Kudos
calvaryftl
Level 7

Re: roTextScreen button problem

Thanks for jumping in Chris. I'm using the textScreen because I don't know how long the text will be as it comes out of the database. It varies each day. I guess I can just eliminate the button for now. Most people should know to hit the back button anyway.

Kenny
0 Kudos
TheEndless
Level 9

Re: roTextScreen button problem

You could also add some carriage returns to the end of the text to ensure it's longer than the dialog box. I'd probably suggest not getting rid of the button. I don't know who your target audience is, but based on experience, if exiting a screen is not obvious, some percentage of your user base will get confused.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
calvaryftl
Level 7

Re: roTextScreen button problem

I just noticed your reply to this thread Endless. Thank you for the suggestion. I think I did that already. Either that or perhaps the 4.9 firmware fixed that bug. It's not happening on any of my screens now.
0 Kudos