]>
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 #if !USE_SHARED_LIBRARY
31 IMPLEMENT_ABSTRACT_CLASS(wxTimer
, wxObject
)
34 static wxList
wxTimerList(wxKEY_INTEGER
);
36 void wxTimerCallback (wxTimer
* timer
)
38 // Check to see if it's still on
39 if (!wxTimerList
.Find((long)timer
))
43 return; // Avoid to process spurious timer events
45 if (!timer
->m_oneShot
)
46 timer
->m_id
= XtAppAddTimeOut((XtAppContext
) wxTheApp
->GetAppContext(),
48 (XtTimerCallbackProc
) wxTimerCallback
,
64 wxTimerList
.DeleteObject(this);
67 bool wxTimer::Start(int milliseconds
, bool mode
)
71 (void)wxTimerBase::Start(milliseconds
, mode
);
73 if (!wxTimerList
.Find((long)this))
74 wxTimerList
.Append((long)this, this);
76 m_id
= XtAppAddTimeOut((XtAppContext
) wxTheApp
->GetAppContext(),
78 (XtTimerCallbackProc
) wxTimerCallback
,
87 XtRemoveTimeOut (m_id
);