I have a situation where I want a form to send an event to another form when it closes and ask it to perform an application-specific function.
I was suprised that there is not an event type for app-specific events or events carrying app-specific pointers or data. We use this kind of thing all the time in Windows programming.
I solved my problem by enqueueing a Key event, but this seems sort of like a hack.
How is such a thing normally accomplished in Palm OS? Do applications just define their own event type that's greater than the OS defined events?
There are custom events in Palm OS. Look in Event.h for firstUserEvent, lastUserEvent, and the generic union member in the EventType struct definition to get an idea of how to do this.
However, they aren't as useful as on Windows -- the big difference is that on Windows, each window has its own event queue, and you can also send an event to another window and have it handle it directly. On Palm OS, there's only one event queue that's always consumed by the active window. This means that the only way to post an event to another window is to put it on the queue and hope that window is the next one to activate.
-- Ben Combee, Senior Software Engineer, palmOne, Inc. "Combee on Palm OS" weblog: http://palmos.combee.net/ Developer Forum Archives: http://news.palmos.com/read/all_forums/
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/