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: 
cdkelly
Level 8

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
Level 7

Re: roMessageDialog Losing Event Loop

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

Re: roMessageDialog Losing Event Loop

What screen type is this dialog show over?

- Joel
0 Kudos
EnTerr
Level 11

Re: roMessageDialog Losing Event Loop

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

Re: roMessageDialog Losing Event Loop

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