]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/timer.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "timer.h"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 IMPLEMENT_DYNAMIC_CLASS(wxTimer
,wxObject
)
24 gint
timeout_callback( gpointer data
)
26 wxTimer
*timer
= (wxTimer
*)data
;
28 if (timer
->OneShot()) timer
->Stop();
32 wxTimer::wxTimer(void)
39 wxTimer::~wxTimer(void)
44 int wxTimer::Interval(void)
49 bool wxTimer::OneShot(void)
54 void wxTimer::Notify(void)
58 void wxTimer::Start( int millisecs
, bool oneShot
)
60 if (millisecs
!= -1) m_time
= millisecs
;
62 m_tag
= gtk_timeout_add( millisecs
, timeout_callback
, this );
65 void wxTimer::Stop(void)
68 gtk_timeout_remove( m_tag
);