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
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
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
Thanks Endless let me give that a whirl
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.
No, you’d need to put the ShowMessageBox function out by itself, and put the “result = ShowMessageBox…” code inside your event loop.
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