bgardella
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2013
02:07 PM
Back Button Detection is a nightmare!
I've seen some good advice about back button detection, such as making sure dialogs are closed, etc. And I'm not a beginner at all. But my channel has major inconsistencies about when the back button events are captured in event loops. ANY advice about this would be appreciated. Here's my example:
I open an "roGridScreen" and wait loop as usual (code is condensed for brevity):
What I find baffling is that the back button will not work initially. But if I open the second grid, it will respond to "back" and then the primary grid ALSO responds to back, i.e. msg.isScreenClosed()
Any ideas what I'm not catching?
I open an "roGridScreen" and wait loop as usual (code is condensed for brevity):
port=CreateObject("roMessagePort")
screen = CreateObject("roGridScreen")
screen.Show()
while true
msg = wait(0, port)
if msg <> invalid AND msg.isScreenClosed() then
print "back button on Main Grid DETECTED!"
return ""
end if
'''''more logic that ultimately opens a second grid...
returnState = ShowSecondGrid()
'''''more logic to handle returnState
end while
What I find baffling is that the back button will not work initially. But if I open the second grid, it will respond to "back" and then the primary grid ALSO responds to back, i.e. msg.isScreenClosed()
Any ideas what I'm not catching?
2 REPLIES 2

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2013
04:12 PM
Re: Back Button Detection is a nightmare!
Aren't you missing a call to SetMessagePort to associate the port with the screen?
--Mark
--Mark
damon1337
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2015
08:49 AM
Re: Back Button Detection is a nightmare!
I feel ya man. I think roMessageDialogEvent must not count the back button as a screenClosed event. Home counted for me but back wouldn't.
:arrow: :evil:
Can anybody confirm?
Thanks
:arrow: :evil:
Can anybody confirm?
Thanks