I've written a simple application that views some files on mounted VFS
volumes. It registers callbacks for the sysNotifyVolumeMounted and
sysNotifyVolumeUnmounted notifications. When the memory card is inserted,
it shows appropriate widgets; when the card is removed, it hides all of the
widgets and displays a "Please insert a memory card." label.
Unfortunately it seems that things go awry when a menu is visible. The
system does not dismiss menus automatically when issuing mount/unmount
notifications (why not?), so when my application hides/unhides its widgets
with FrmHideObject and FrmShowObject, all the drawing gets done in the
menu's window.
Here are some problems I've noted:
* There does not seem to be a direct way to dismiss a menu manually using
the public API.
* There are no glue routines to determine if a menu is visible. If I can
determine if a menu is visible, then I can issue a vchrMenu
keyDownEvent to dismiss the menu.
* Always calling MenuEraseMenu first in the mount/unmount callbacks works
and seems to be the simplest solution, except that its interface is not
publicly documented. (Again, why not?)
* Following the SDK reference's suggestion of monitoring winEnter and
winExit events would work, but this seems a bit convoluted to me,
especially since I'm not calling any drawing routines explicitly.
Does anyone have any other suggestions about how to go about avoiding this
issue, or is checking winEnter/winExit really the best thing to do?
Thanks,
- James
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/