]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/timer.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTimer implementation
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "timer.h"
21 #pragma message disable nosimpint
25 #pragma message enable nosimpint
28 #include "wx/motif/private.h"
30 IMPLEMENT_ABSTRACT_CLASS(wxTimer
, wxObject
)
32 static wxList
wxTimerList(wxKEY_INTEGER
);
34 void wxTimerCallback (wxTimer
* timer
)
36 // Check to see if it's still on
37 if (!wxTimerList
.Find((long)timer
))
41 return; // Avoid to process spurious timer events
43 if (!timer
->m_oneShot
)
44 timer
->m_id
= XtAppAddTimeOut((XtAppContext
) wxTheApp
->GetAppContext(),
46 (XtTimerCallbackProc
) wxTimerCallback
,
62 wxTimerList
.DeleteObject(this);
65 bool wxTimer::Start(int milliseconds
, bool mode
)
69 (void)wxTimerBase::Start(milliseconds
, mode
);
71 if (!wxTimerList
.Find((long)this))
72 wxTimerList
.Append((long)this, this);
74 m_id
= XtAppAddTimeOut((XtAppContext
) wxTheApp
->GetAppContext(),
76 (XtTimerCallbackProc
) wxTimerCallback
,
85 XtRemoveTimeOut (m_id
);