Hi All,
Got a bit of a strange situation, and was hoping someone could shed some
light on what might be going on here.
My game starts up, loads its main form, and starts into the main event
loop. Click the menu silk button, and get appropriate Exit/Enter
events. Click it again, menu goes away, and the application gets the
enter into the main form's window so that the game can continue because
it detects the winEnterEvent back into the main window.
Now, pull up the about box (displayed using FrmDoDialog), and then
dismiss it.
Now, click on the menu silk, and tap it again to dismiss it, and some
other window is claimed as getting the enter/leave events from the menu,
so the game locks up, but only after having called another form using
FrmDoDialog.
I've tried FrmSetActiveForm after the About box, and I've tried
FrmSaveActiveState/FrmRestoreActiveState to attempt to save the main
window as the one that's active around the FrmDoDialog, but no luck.
(Below, I've gone into quite a bit more detail for those with strong
constitutions and morbid curiosity.)
Any ideas what might be causing this? (and how I could get around it?)
-Ken
All this is looking in my Application Event Handler routine.
First, I just want to leave and enter the main window...
If I click on the menu silkscreen, I get four events:
mnuOpenEvent
winExitEvent(entering 0x0, leaving 0xad16ac, my main form's window)
winEnterEvent(entering 0x0, leaving 0xad16ac, my main form's window)
penUpEvent
My application successfully detects this, and stops the game action.
Now, I click on the menu silk screen again, and get three events:
winExitEvent(entering 0xad16ac, my main form's window, leaving 0x0)
winEnterEvent(entering 0xad16ac, my main form's window, leaving 0x0)
Again, this is detected, and the game starts up.
Okay, to get fancier:
I click on the menu silk:
winExitEvent(entering 0x0, leaving 0xad16ac, my main form's window)
winEnterEvent(entering 0x0, leaving 0xad16ac, my main form's window)
Now, I select my 'about this app' menu item.
winExitEvent(entering 0xad16ac, my main form's window, leaving 0x0)
winEnterEvent(entering 0xad16ac, my main form's window, leaving 0x0)
menuEvent
And now the About box is displayed.
My About box handling code is this:
------------------------------------------------
WinSetCoordinateSystem (kCoordinatesNative);
if (menuID==mnuHelp) {
frm = FrmInitForm ( frmHelp );
} else {
frm = FrmInitForm ( frmAbout );
}
FrmDrawForm ( frm );
FrmDoDialog ( frm );
WinSetCoordinateSystem (kCoordinatesNative);
pow_drawContext.liveAnimation=true;
------------------------------------------------
So, now I click 'ok' in my dialog box, and fall out of the FrmDoDialog:
winExitEvent(entering 0xad16ac, my main form's window, leaving 0xad4428)
winEnterEvent(entering 0xad16ac, my main form's window, leaving
0xad4428)
penUpEvent
The game seems to be running as before, but here's the problem...
Now, I click on the menu silk button again:
winExitEvent(entering 0xad4428, my main form's window, leaving 0xad16ac)
winEnterEvent(entering 0xad4428, my main form's window, leaving
0xad16ac)
menuOpenEvent
winExitEvent(entering 0x0, my main form's window, leaving 0xad4428)
winEnterEvent(entering 0x0, my main form's window, leaving 0xad4428)
And click on the menu button again:
winExitEvent(entering 0xad4428, my main form's window, leaving 0x0)
winEnterEvent(entering 0xad4428, my main form's window, leaving 0x0)
Now, because I'm not entering the main window (0xad16ac), my application
doesn't know that the game can continue, so the game is now 'frozen'.
If the user tries to load the about box again, the game is happy, but
this is clearly sub-optimal.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/