Home » U++ Library support » U++ Callbacks and Timers » how to use timer id? and how to kill a timer
Re: how to use timer id? [message #27495 is a reply to message #27480] |
Wed, 21 July 2010 10:46   |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
First question:
The enum is to ensure that you don't use ids that are already used by your base classes. For instance, if TopWindow had:
enum { TIMEID_TIMER1 = Ctrl::TIMEID_COUNT,
TIMEID_TIMER2,
TIMEID_TIMER3,
TIMEID_COUNT };
and your class
enum { TIMEID_PERIODIC_TIMER = TopWindow::TIMEID_COUNT,
TIMEID_COUNT };
Then TIMEID_PERIODIC_TIMER would be 3, and TopWindow would use ids 0,1,2. In practice I've never found a situation where this is a problem but it's good practice and not much work.
Second question:
I'm not 100% sure I understand you, but in this situation I would just pass a Callback the the Thread as a parameter. The Thread can then execute the Callback when it's ready to create the timer.
|
|
|
 |
|
how to use timer id? and how to kill a timer
By: bonami on Tue, 20 July 2010 10:03
|
 |
|
Re: how to use timer id?
By: mrjt on Wed, 21 July 2010 10:46
|
 |
|
Re: how to use timer id?
By: bonami on Wed, 21 July 2010 11:28
|
 |
|
Re: how to use timer id?
By: mrjt on Wed, 21 July 2010 12:54
|
 |
|
Re: how to use timer id?
By: bonami on Thu, 22 July 2010 04:09
|
 |
|
Re: how to use timer id?
By: mrjt on Thu, 22 July 2010 10:58
|
 |
|
Re: how to use timer id?
By: bonami on Thu, 22 July 2010 11:32
|
 |
|
Re: how to use timer id?
By: mrjt on Thu, 22 July 2010 12:10
|
 |
|
Re: how to use timer id?
By: bonami on Fri, 23 July 2010 04:28
|
 |
|
Re: how to use timer id?
By: mrjt on Fri, 23 July 2010 11:32
|
 |
|
Re: how to use timer id?
By: bonami on Mon, 26 July 2010 04:16
|
Goto Forum:
Current Time: Wed Aug 27 14:27:26 CEST 2025
Total time taken to generate the page: 0.05916 seconds
|