Looks like you've got some flashing words happening there.  cool.

Here's what I'd do:

Have a global called gEvtTimeout.  Normally the global will be set to
evtWaitForever.  Use this global like so in your event loop:  EvtGetEvent
(&event, gEvtTimeout);

When you are ready to starting flashing those words, set gEvtTimeout to 50
(then you won't need that SysTaskDelay).  This will cause a nil event to be
generated once every 50 ticks.  event->eType will be "nilEvent".  When you
get a nil event call your "flash words" function.  When you get a pen down
event, set gEvtTimeout back to evtWaitForever.

One more thing:  I've heard that its a bad idea to set handled = true for a
nil event, but I don't know why.

Let me know if you've got questions.

Brian.


"Prasad" <[EMAIL PROTECTED]> wrote in message news:20621@palm-dev-forum...
>
> Hi all,
>     How to break an infinite loop when a pendown event fires?Can any body
in
> this snippet code ?
>
>   FrmNewGadget(&frm, 1250, 10, 60, 140, 30);
>   FrmDrawForm(frm);
>   FrmGetObjectBounds(frm, FrmGetObjectIndex(frm,1250), &gR);
>   WinDrawRectangleFrame(1, &gR);
>   FntSetFont(largeBoldFont);
>
>   while(true)
>   {
>    tempstr = MemPtrNew(10);
>    StrNCopy(tempstr, newText, 10);
>    WinDrawChars(tempstr,10, gR.topLeft.x + 20, gR.topLeft.y + 5);
>    MemPtrFree(tempstr);
>
>    newText = newText + 10;
>    SysTaskDelay(50);
>    WinEraseRectangle(&gR, 0);
>     /*EvtGetEvent(&event, -1);*/
>   }
>
> I would like to break this loop when a pendown event occurs.
> Any help????
>
> thanks
> Prasad
>
>
>



-- 
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