paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [paragui-users] re: timer widget


From: Alexander Pipelka
Subject: Re: [paragui-users] re: timer widget
Date: 28 May 2002 22:23:24 +0200

Forget that crap i wrote before :))

Ok. I implemented that class it's in CVS ("devel-1-0" branch) and the
animation sample is using it.

Have fun

Alex


Am Die, 2002-05-28 um 21.13 schrieb Alexander Pipelka:
> Am Die, 2002-05-28 um 20.07 schrieb Keith Swyer:
> > took a look at the animation.cpp and it's what i'm looking for, minus the
> > use of SDL_AddTimer as it requires threads. THe
> > SetEventCallback(MSG_APPIDLE, ...,...) and enabling the appidle calls seems
> > to work partially. i have not been able to set two different callbacks to
> > run on the MSG_APPIDLE message. is it even possible??
> 
> Hmm,...
> This piece of code wasn't written by myself,...
> 
> I'm just thinking about a clean implementation of timers.
> What about introducing something like PG_TimerObject ?
> 
> Here a quick draft:
> 
> class PG_TimerObject : protected map<int, PG_TimerObject*> {
> 
> public:
>       PG_TimerObject() {
>               initialize SDL_Time on first instance
>       }
> 
>       virtual ~PG_TimerObject();
> 
>       virtual eventTimer(int id);
> 
>       int AddTimer(int delay);
> 
>       int RemoveTimer(int id);
> 
> private:
> 
>       static int callbackTimer(int id) {
>               *this[id]->eventTimer(id);
>       }
> 
> }
> 
> Should be no problem to implement and would solve all timer problems :))
> 
> Ideas ?
> 
> Alex
> 
> 
> 
> 
> _______________________________________________
> paragui-users mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users






reply via email to

[Prev in Thread] Current Thread [Next in Thread]