kyleabaker
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2014
04:58 PM
Change button text on SpringboardScreen without losing focus
I have a SpringboardScreen with several buttons, some perform toggle functions where I'd like to change the text from "Option On" to "Option Off". I've determined that I can clear the buttons and add them again with correct text, however, the UseStableFocus(true) setting seems to be ignored since the buttons were cleared. Ultimately I would like to change the text of a button without moving off of the selected button. Am I missing a step here?
3 REPLIES 3

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2014
06:43 PM
Re: Change button text on SpringboardScreen without losing f
UseStableFocus() should work, even with clearing and re-adding the buttons. That's how navigating left and right work. Can you share the code you're using to reset the buttons?
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)
kyleabaker
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2014
05:33 AM
Re: Change button text on SpringboardScreen without losing f
Below is a skeleton of the code I'm working with. Is this an invalid approach?
' Code to initialize springboard here
'....
springBoard.UseStableFocus(true)
regenerateSpringBoardButtons:
springBoard.ClearButtons()
If (isToggledOn = true) Then
springBoard.AddButton(1,"Option On")
Else
springBoard.AddButton(1,"Option Off")
End If
springBoard.SetContent(o)
springBoard.Show()
While True
msg = wait(0, port)
If msg.isScreenClosed() Then
Return -1
Elseif msg.isButtonPressed()
print "msg: "; msg.GetMessage(); "idx: "; msg.GetIndex()
idx = msg.GetIndex()
If (idx = 1) Then
updateOptionToggleState()
goto regenerateSpringBoardButtons
End If
Endif
End While
kyleabaker
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2014
06:49 AM
Re: Change button text on SpringboardScreen without losing f
Resolved
For anyone seeing this issue in the future, I've actually resolved this issue now by using AllowUpdates() which I wasn't previously using. You may also notice that I pull the SetContent out of the GoTo loop, that was just because it wasn't necessary to set each time. See corrected code below:
For anyone seeing this issue in the future, I've actually resolved this issue now by using AllowUpdates() which I wasn't previously using. You may also notice that I pull the SetContent out of the GoTo loop, that was just because it wasn't necessary to set each time. See corrected code below:
' Code to initialize springboard here
'....
springBoard.UseStableFocus(true)
springBoard.SetContent(o)
regenerateSpringBoardButtons:
springBoard.AllowUpdates(false)
springBoard.ClearButtons()
If (isToggledOn = true) Then
springBoard.AddButton(1,"Option On")
Else
springBoard.AddButton(1,"Option Off")
End If
springBoard.AllowUpdates(true)
springBoard.Show()
While True
msg = wait(0, port)
If msg.isScreenClosed() Then
Return -1
Elseif msg.isButtonPressed()
print "msg: "; msg.GetMessage(); "idx: "; msg.GetIndex()
idx = msg.GetIndex()
If (idx = 1) Then
updateOptionToggleState()
goto regenerateSpringBoardButtons
End If
Endif
End While