It is possible to do this with push button if I intercept ctlEnterEvent(or pendownevent) and penUpEvent, calculate their interval with function "TimGetSeconds", and use function "CtlSetValue" to set push button's value (on or off).
The problem is function "TimGetSeconds" only returns time in seconds "since 12:00 A.M. on January 1, 1904". This is not accurate enough. Plam OS does not provide functions to retrieve such a time in milliseconds. I did not find Palm OS have a Timer function either. You proposed a feasible way, but I think I still need a Timer to calculate the intervals between two events (pendown and penup). Am I right? Eric *********** REPLY SEPARATOR *********** On 16/04/2004 at 12:47 PM Dan Sandler wrote: >Eric, > >There's no way to do this with the basic button/push button controls in >Palm OS. You'll have to write a gadget (custom control) to create this >behavior. > >-- >Dan Sandler >PalmSource, Inc. > >Eric Yun wrote: > >> hello guys, >> >> I need a button (or push button). It usually acts like a button, but if >the user presses and holds it for some time (say, 1 sec), it acts like a >push button and reverse its color. Is it possible to set button's or >pushbutton's attributes to make such a button? >> >> thanks, >> >> Eric >> >> -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
