At 8:28 AM -0700 1999/11/05, Miller, Gary wrote:
>i want to queue an event to happen several times in a row. i've
>successfully used EvtAddEventToQueue( EventPtr) to append events to the
>Event Queue, but only the first of the events occurs. my loop iterates
>correctly, and a different pointer value is assigned to each event enqueued.
>is there some formality i'm missing? do i need to set values for penDown,
>screenX, or screenY? it would be nice to be able to examine the event queue
>at run-time.
>
>for( i=0; i < n; i++)
>{
> pNewEvent = MemPtrNew( sizeof( EventType) );
> pNewEvent->eType = menuEvent;
> pNewEvent->data.menu.itemID = 1400;
> EvtAddEventToQueue( pNewEvent);
> // assumed pNewEvent is deleted from queue when event removed
>}
Only enqueue one event at a time per iteration of your main event loop (i.e. don't
enqueue events in a loop that way) or else you risk overflowing the queue. And be sure
to zero out the entire event structure (e.g. using memset) before calling
EvtAddEventToQueue. The specifics of which fields to set for each event depend on the
event type.
Regards,
Jim Schram
3Com/Palm Computing
Partner Engineering