virtual bool Start(int milliseconds = -1, bool oneShot = false);
virtual void Stop();
+ // for wxTimerScheduler only: resets the internal flag indicating that the
+ // timer is running
+ void MarkStopped()
+ {
+ wxASSERT_MSG( m_isRunning, _T("stopping non-running timer?") );
+
+ m_isRunning = false;
+ }
+
private:
bool m_isRunning;
-
- friend class wxTimerScheduler;
};
// ----------------------------------------------------------------------------
#include "wx/log.h"
#include "wx/apptrait.h"
#include "wx/platinfo.h"
+#include "wx/wxchar.h"
// without this pragma, the stupid compiler precompiles #defines below so that
// changing them doesn't "take place" later!
virtual void Notify()
{
wxPrintf(_T("%d"), m_num++);
+ fflush(stdout);
if ( m_num == 10 )
{
wxEventLoop loop;
+ wxTimer timer1;
+ timer1.Start(100, true /* one shot */);
+ timer1.Stop();
+ timer1.Start(100, true /* one shot */);
+
MyTimer timer;
timer.Start(500);
wxUnixTimerImpl * const timer = s->m_timer;
if ( timer->IsOneShot() )
{
+ // the timer needs to be stopped but don't call its Stop() from
+ // here as it would attempt to remove the timer from our list and
+ // we had already done it, so we just need to reset its state
+ timer->MarkStopped();
+
// don't need it any more
delete s;
}