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

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:

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.

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.. :wink:

Excellent, thank you! I will give this a try.