X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07d7f20b5066d006563a143cb88e65ae04a4075f..0f05afccede840e04872bfc82103b689b8edc447:/src/common/timercmn.cpp diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp index f1173ff163..e90b5fd4ad 100644 --- a/src/common/timercmn.cpp +++ b/src/common/timercmn.cpp @@ -115,6 +115,26 @@ void wxTimerBase::Notify() (void)m_owner->ProcessEvent(event); } +bool wxTimerBase::Start(int milliseconds, bool oneShot) +{ + if ( IsRunning() ) + { + // not stopping the already running timer might work for some + // platforms (no problems under MSW) but leads to mysterious crashes + // on the others (GTK), so to be on the safe side do it here + Stop(); + } + + if ( milliseconds != -1 ) + { + m_milli = milliseconds; + } + + m_oneShot = oneShot; + + return TRUE; +} + #endif // wxUSE_GUI // ----------------------------------------------------------------------------