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