It is possible to ignore penDownEvents by checking for them in your app's
event loop and then not passing them on to SysHandleEvent. But this is
something you would rarely do. It sounds like you may not be correctly
understanding how a Palm app works. The Palm OS is event driven. You write
code to respond to events sent to you by the OS. If the user taps on a
button, various events get generated (including the penDownEvent) and your
code should respond to it by doing something or you should pass it on to the
OS to deal with it in the normal manner (for example, highlighting the
button when it is tapped).
You say "when I press the button during the execution of Myfunction()..."
What are you trying to accomplish in Myfunction() that requires you to
disable pen taps while it is executing? If you really need to do something
in-between pen taps, the normal way to do that is to call your code from
within the event loop. Look at the source code for one of the Palm games
(e.g., HardBall or Reptoids) to see how that is handled.
----- Original Message -----
From: "Jacky Cheung" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Tuesday, December 19, 2000 1:28 PM
Subject: RE: Unable to disable a control button
> If that is the case, is there anyway I can get rid of the penDownEvent
> before I enable the cntrol again? Or any suggestion what I should do?
> (Sorry, I am new to Palm programming).
>
> Thanks alot.
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Ben
> Combee
> Sent: Wednesday, December 20, 2000 8:15 AM
> To: Palm Developer Forum
> Subject: Re: Unable to disable a control button
>
>
> "Jacky Cheung" <[EMAIL PROTECTED]> wrote in message
> news:33462@palm-dev-forum...
> >
> > I tried to disable a control button by using
> >
> > CtlSetEnabled( ...., false);
> > Myfunction();
> > CtlSetEnabled( ....., true);
> >
> > but when I press the button during the execution of Myfunction(), the
> system
> > still respond to the button I pressed during that time after
Myfunction()
> > has finished.
> > Any idea?
>
> Is there an event loop active during Myfunction()? If not, then your
> penDownEvent isn't being handled until after you return from MyFunction
and
> call CtlSetEnabled(), so when the event loop is entered, your control is
> enabled again.
>
> --
> Ben Combee
> Veriprise Wireless <http://www.veriprise.com>
>
>
>
> --
> 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/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/