From: "Brad Figler" <[EMAIL PROTECTED]> > I will, ofcourse, document the HECK out of my code where I use the custom > event. I will need to do more custom events as my app moves out of infancy > in to its toddler stage and will need a bit more sophisticated custom event > handling. > > I just wanted to hear the opinions of people who have made this stuff work > in the pass. > Sorry I didn't pick up on this earlier but if this is a serious app you should probably avoid custom events because some PalmOS activity will eat them. You can't gauranteee that your app will see every event it posts.
Any PalmOS activity that has it's own event handler (dialogs, the popup keyboard (?), etc) will throw away your custom event if it receives it. This means that to gaurantee that the event is received by your app you have to replace all PalmOS objects with your own objects so that you can check for these events. This isn't impossible (I use my own dialog and alert handlers to run background code but haven't thought about replacing the popup keyboard) but adds work to your job. I found it much better to create my own event queue. This is less work than over-riding the PalmOS object and, as well as making delivery of the event more certain, also let's you make the queue a suitable depth for your application (as others have mentioned, the PalmOS queue is quite shallow). You also aren't bound by the PalmOS event structure and can create something that is more suitable for your needs. All you really need is an array of pointers to event structures, a function to add an event to the array and a function to return an event if there's one waiting. Chris Tutty. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
