]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/timer.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "timer.h"
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
27 static GTimer *g_timer = (GTimer*) NULL;
33 g_timer_rest( g_timer );
37 g_timer = g_timer_new();
38 g_timer_start( g_timer );
42 long wxGetElapsedTime( bool resetTimer )
47 g_timer_elapsed( g_timer, &res );
48 if (resetTimer) g_timer_reset( g_timer );
54 bool wxGetLocalTime( long *timeZone, int *dstObserved )
58 long wxGetCurrentTime()
64 //-----------------------------------------------------------------------------
66 //-----------------------------------------------------------------------------
68 IMPLEMENT_ABSTRACT_CLASS(wxTimer
,wxObject
)
70 gint
timeout_callback( gpointer data
)
72 wxTimer
*timer
= (wxTimer
*)data
;
95 bool wxTimer::Start( int millisecs
, bool oneShot
)
104 m_tag
= gtk_timeout_add( millisecs
, timeout_callback
, this );
113 gtk_timeout_remove( m_tag
);