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 /* when getting called from GDK's timer handler we
34 are no longer within GDK's grab on the GUI
35 thread so we must lock it here ourselves */
40 /* release lock again */
43 if ( timer->IsOneShot() )
60 bool wxTimer::Start( int millisecs, bool oneShot )
62 (void)wxTimerBase::Start(millisecs, oneShot);
65 gtk_timeout_remove( m_tag );
67 m_tag = gtk_timeout_add( m_milli, timeout_callback, this );
76 gtk_timeout_remove( m_tag );