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: 
Highlighted

Dialogo box in SpringBoard ?

Is this possible or am i treading my wheels on nothing?

I am trying to get the tweet button i have on my spring board to popup and confirm they want to tweet what they are watching.

as it is now it will just tweet as soon as they click the button
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
5 Replies
Highlighted
Level 8

Re: Dialogo box in SpringBoard ?

I have a Utility function for this purpose. You're welcome to use it...

Function ShowMessageBox( title As String, message As String, buttons = [ "OK" ] )
messageBox = CreateObject( "roMessageDialog" )
messageBox.SetMessagePort( CreateObject( "roMessagePort" ) )
messageBox.SetTitle( title )
messageBox.SetText( message )
For buttonIndex = 0 To buttons.Count() - 1
messageBox.AddButton( buttonIndex, buttons[ buttonIndex ] )
Next
messageBox.Show()
While True
msg = wait( 0, messageBox.GetMessagePort() )
If msg <> invalid Then
If Type( msg ) = "roMessageDialogEvent" Then
If msg.IsButtonPressed() Then
Return buttons[ msg.GetIndex() ]
End If
End If
End If
End While
End Function

In your case, you'd call it like this...

result = ShowMessageBox("Confirm", "Are you sure you want to blah blah blah?", [ "Yes", "No" ])
If result = "Yes" Then
'Do that thing...
End If
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
Highlighted

Re: Dialogo box in SpringBoard ?

Thanks Endless let me give that a whirl
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
Highlighted

Re: Dialogo box in SpringBoard ?

actually its doing the same thing to me as my function was.

i have it set up when i click one of the buttons so it goes like this

if msg.index() = 4
<code you gave me>
end if


and it keeps giving me this error, i got this on the one i was trying to...

*** ERROR compiling /pkg:/source/appDetailScreen.brs:
line 104, error code &h02: Syntax Error
line 123, error code &h02: Syntax Error


can i not have a function here? i tried " Sub" too but got the same errors.
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
Highlighted
Level 8

Re: Dialogo box in SpringBoard ?

No, you'd need to put the ShowMessageBox function out by itself, and put the "result = ShowMessageBox..." code inside your event loop.
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
Highlighted

Re: Dialogo box in SpringBoard ?

LOL, i am so sorry thats what i did the first time! then i thought it was wrong.

seems to be working now, let me check my Twitter to see if it is working, Thanks Endless
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos