jmacfl
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2012
08:42 AM
Adding a countdown or timer to a springboard screen?
Hi All,
Is it possible to add a countdown to a springboard screen (or create a custom screen with a countdown)? The scenario is i have a live feed that is only active during special events not 24/7. The client would like the ability to have a count down showing when the next live event starts. This would be updated each second as it counts down.
In searching the forum i found references back in 2006 and 2008 to a component called a "roTextWidget", which seemed to allow updating the text using a given period, but can find no trace of it in the current documentation. Can anyone point me in the right direction? Is it possible to do this? Ideally i would want to add the text in the description text area as line 1 but could also see it in the button area of the springboard layout.
Thanks
Jeff
Is it possible to add a countdown to a springboard screen (or create a custom screen with a countdown)? The scenario is i have a live feed that is only active during special events not 24/7. The client would like the ability to have a count down showing when the next live event starts. This would be updated each second as it counts down.
In searching the forum i found references back in 2006 and 2008 to a component called a "roTextWidget", which seemed to allow updating the text using a given period, but can find no trace of it in the current documentation. Can anyone point me in the right direction? Is it possible to do this? Ideally i would want to add the text in the description text area as line 1 but could also see it in the button area of the springboard layout.
Thanks
Jeff
3 REPLIES 3

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2012
11:34 AM
Re: Adding a countdown or timer to a springboard screen?
You could update the content of the screen every second using screenVarName.setcontent(content) or you could have a function that updates the buttons on the screen every so often:
The trick is to set your msg=wait to a non-zero time so that it doesn't block execution and updates while waiting for a keypress:
msg=wait(1000,port) 'a one second wait.
function reloadbuttons(screen as object, time as string) as object
screen.clearbuttons()
if time <> "0:00" then
screen.addbutton(0,time+" till show start")
else
screen.addbutton(0,"Play")
end if
return screen
end function
The trick is to set your msg=wait to a non-zero time so that it doesn't block execution and updates while waiting for a keypress:
msg=wait(1000,port) 'a one second wait.

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2012
11:38 AM
Re: Adding a countdown or timer to a springboard screen?
You'd also want to be sure to set UseStableFocus() to true, otherwise the selected button will reset to the first button on every refresh. If you're updating every second, that could get very frustrating for your users.. 😉
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
jmacfl
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2012
11:56 AM
Re: Adding a countdown or timer to a springboard screen?
Excellent, thank you! I will give this a try.