roquoonewbie
14 years agoVisitor
EnableBackButton does not work unless AddButton is used
I think there is a bug with the roMessageDialog object. Specifically, I cannot get the back button event unless I also add a button to the dialog.
I do not want to have any button on the dialog, but I do want the user to be able to press back to quit the dialog. However, in the below code, the only way I can get the event is if I include a dummy button. Can anyone confirm they see the same? Can Roku confirm this is a bug?
Function testBackButton() As Void
port = CreateObject("roMessagePort")
dialog = CreateObject("roMessageDialog")
dialog.SetMessagePort(port)
dialog.SetText("Testing Back Button")
dialog.EnableBackButton(true)
dialog.AddButton(1, "Go Back") 'This line must be present otherwise back button event never occurs
dialog.Show()
while true
dlgMsg = wait(0, port)
if type(dlgMsg) = "roMessageDialogEvent"
Dbg("EVENT RECEIVED") 'Never gets executed unless AddButton is included above
if dlgMsg.isScreenClosed() or dlgMsg.isButtonPressed()
exit while
end if
end if
end while
End Function
I do not want to have any button on the dialog, but I do want the user to be able to press back to quit the dialog. However, in the below code, the only way I can get the event is if I include a dummy button. Can anyone confirm they see the same? Can Roku confirm this is a bug?
Function testBackButton() As Void
port = CreateObject("roMessagePort")
dialog = CreateObject("roMessageDialog")
dialog.SetMessagePort(port)
dialog.SetText("Testing Back Button")
dialog.EnableBackButton(true)
dialog.AddButton(1, "Go Back") 'This line must be present otherwise back button event never occurs
dialog.Show()
while true
dlgMsg = wait(0, port)
if type(dlgMsg) = "roMessageDialogEvent"
Dbg("EVENT RECEIVED") 'Never gets executed unless AddButton is included above
if dlgMsg.isScreenClosed() or dlgMsg.isButtonPressed()
exit while
end if
end if
end while
End Function