I want to do is to do some animation.
In the ideal world I would set up a "DanEvent" that would be generated every X ticks
of the clock. I understand how this can be done with "nilEvents" but the facts remain
that
my main form handler (the stub of which was generated by codewarrior) looks like this:
(My comments are in UPPERCASE)
All I wanted to do here was to have a button on my form generate the first nilEvent
and have
each nilEvent following this be generated by a call to evtGetEvent from within
nilEvent case.
I KNOW that I should be checking on the time and making sure that the nill events I
receive
are "mine" but I figured that for now I'd be happy with getting more nilEevents than I
was expecting...
but quite the opposite happens! I get NO nilEvents! (I am indicating that a nilEvent
has occured
by printing out the number of ticks using WinDrawChars().
Where are all the nil Events going? I've tried messing with the timeout value on the
evtGetEvent
call to no avail!
static Boolean MainFormHandleEvent(EventPtr eventP)
{
Boolean handled = false;
FormPtr frmP;
Word wIDMainToggleCheckBox, wIDMainTimeField;
ControlPtr pCtlMainToggleCheckBox;
static int iToggle=0;
FieldPtr pCtlField;
ULong ulongCurrentTicks;
char cFubar[8];
switch (eventP->eType)
{
case menuEvent:
return MainFormDoCommand(eventP->data.menu.itemID);
case frmOpenEvent:
frmP = FrmGetActiveForm();
MainFormInit( frmP);
FrmDrawForm ( frmP);
handled = true;
break;
case ctlSelectEvent:
if (eventP->data.ctlEnter.controlID == MainGoButton) {
//USER HAS PUSHED THE GO BUTTON!
EvtGetEvent(eventP, 100);
}
break;
case nilEvent:
//NEVER GETS HERE! (EXCEPT UNDER POSE)
ulongCurrentTicks=TimGetTicks();
StrIToA(cFubar,ulongCurrentTicks);
WinDrawChars(cFubar,StrLen(cFubar),100,100);
EvtGetEvent(eventP, 100);
handled = true;
break;
default:
break;
}
return handled;
}
Aaron Ardiri wrote:
> > Hi!
> >
> > This is my first post so please be kind.
>
> damn :P
>
> > I am trying to do something which has apparently been done many times over:
> > Namely: "Respond to events that are generated every x ticks."
> > I have read many posts on this topic in the archive and they have gotten me maybe
>50% there.
> >
> > My current situation is that I have a program that makes use of evtGetEvent and
>have set up
> > a place to catch the nilEvent in the switch of my MainFormHandleEvent and generate
>more events.
> > My problems are as follows :
> >
> > 1. While a couple nilEvents are "caught" while running under POSE, NOTHING happens
>on
> > my Visor! I have stepped through the code and it looks like no nilEvent is being
>generated!
> > Or maybe it's getting handled elsewhere?
>
> POSE sends a crap load of nilEvents when you use it.. POSE does not
> act 100% like the device :(( double check your "event" handling, make
> sure you are handling them correctly. if you delegate the events, they
> go there :)
>
> if you want to catch nilEvents always, then do a check in the EventLoop()
> code portion. maybe you are going about it the wrong way as well, what
> exactly do you want to do??
>
> > 2. Even under POSE, successive evtGetEvent calls are (apparently) not "getting
>through"....
> > I would go into more detail, but I don't think it's worthwhile given item #1 above.
> >
> > If some kind soul could email me some working code that just makes a metronome or
>clock of some kind
> > I will name a child after them.
>
> call your kid "ardiri" :) hehe
>
> // az
> [EMAIL PROTECTED]
> www.ardiri.com <--- free games!
>
> --
> 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/