Ah, so I was missing something...  I didn't realize that the model was to loop and 
wait for pen events in the gadget handler.  Certainly this keeps all the state and 
other info in the gadget where it belongs.  It might be good if the gadget docs would 
mention this little "standard" strategy.

Yes, your second paragraph describes exactly the problem I had with the whole thing 
(and exactly what I was doing before).  Now that I have this little tidbit, I can do 
the right (standard) thing.

Thanks!

Kevin

-----Original Message-----
From: David Fedor [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 01, 2002 10:36 AM
To: Palm Developer Forum
Subject: Re: Question regarding use of extended gadgets


>In my earlier development, I found it strange that one gets frmGadgetEnter
>events in the gadget handler, but one never gets penMove, penDown or penUp
>events in the gadget.  This forces one to handle these events in the form
>handler...

Not really.  When the user taps on an extended gadget, it gets an
frmGadgetEnterEvent sent to it.  Standard Palm OS behavior is not to wait
for penMove events, but rather to sit in a loop calling PenGetPoint until
it tells you that it was released.  That's how all the built-in UI objects
work.  (Do call SysTaskDelay() to save the user's battery if at all
possible.)

So the form handler doesn't need to do anything.  If it had to send penMove
events, it'd have to have handled things (which is what you don't want),
because how else would it know who to send the penMove to? Considering the
pen may have moved outside the initial object, it'd have to keep state,
send more exit/enter events, etc.

-David Fedor
PalmSource, Inc.

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to