Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cdkelly
Visitor

roMessageDialog Losing Event Loop

When displaying a message dialog, it seems that sporadically the message dialog will not receive the events. I am using the below code to display the dialog. When it gets into this state, the logs in the event loop will not print out nor the ones I have added after this function returns. The events seem to be going to the screen below the dialog or are lost completely. This does not happen consistently. Does anyone have any ideas? Thanks!

Function DisplayErrorDialog(errorTitle as String, errorMsg As String) as Void
port = CreateObject("roMessagePort")
dialog = CreateObject("roMessageDialog")
dialog.SetMessagePort(port)
dialog.SetTitle(errorTitle)
dialog.SetText(errorMsg)
dialog.AddButton(0, OkString())
print "showing error dialog before"
dialog.Show()
print "showing error dialog"
while true
print "error dialog event loop"
dlgMsg = wait(0, port)
print "error dialog event loop dlgMsg";dlgMsg
if type(dlgMsg) = "roMessageDialogEvent"
if dlgMsg.isScreenClosed()
print "Screen closed"
return
else if dlgMsg.isButtonPressed()
dialog.Close()
return
endif
endif
end while
End Function
0 Kudos
4 REPLIES 4
aagna
Visitor

Re: roMessageDialog Losing Event Loop

Were you able to solve the problem? I am stuck with the same problem.
0 Kudos
RokuJoel
Binge Watcher

Re: roMessageDialog Losing Event Loop

What screen type is this dialog show over?

- Joel
0 Kudos
EnTerr
Roku Guru

Re: roMessageDialog Losing Event Loop

there is no roScreen involved, is there?
Documentation says it does not mingle with everyman components.
0 Kudos
cdkelly
Visitor

Re: roMessageDialog Losing Event Loop

I have seen this issue over both the roGridScreen and the roSpringboardScreen.
0 Kudos