]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/timer.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTimer implementation
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "timer.h"
23 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
27 IMPLEMENT_ABSTRACT_CLASS(wxTimer
, wxObject
)
29 extern "C" gint
timeout_callback( gpointer data
)
31 wxTimer
*timer
= (wxTimer
*)data
;
33 // Don't change the order of anything in this callback!
35 if (timer
->IsOneShot())
37 // This sets m_tag to -1
41 // When getting called from GDK's timer handler we
42 // are no longer within GDK's grab on the GUI
43 // thread so we must lock it here ourselves.
48 // Release lock again.
51 if (timer
->IsOneShot())
68 bool wxTimer::Start( int millisecs
, bool oneShot
)
70 (void)wxTimerBase::Start(millisecs
, oneShot
);
73 gtk_timeout_remove( m_tag
);
75 m_tag
= gtk_timeout_add( m_milli
, timeout_callback
, this );
84 gtk_timeout_remove( m_tag
);