Idle events and timers

If you need to go some processing when the nothing else is happening in the WIMP you can add or remove a tbx:Command derived class to the tbx::Application class with the add_idle_command and remove_idle_command methods.

You may also only wish to do this action after a set amount of time. In this case you add a tbx::Timer derived class to the tbx::Application class using the add_timer method giving it the interval between calls. To stop the timer call the remove_timer method on the tbx::Application class. Timers are only processed when there are no other events so they will not necessarily be delivered exactly on time.

With both idle events and timers it is important that you remove them from the application when they are not required as it improves overall system performance.

The TBX-Examples download contains an application called !StopWatch which demonstrates the use of a timer.