예제 #1
0
파일: timer.cpp 프로젝트: 3v1n0/wxWidgets
void wxTimerCallback (wxMotifTimerImpl *timer)
{
    // Check to see if it's still on
    if ( gs_timers.find(timer) == gs_timers.end() )
        return;

    if ( !timer->IsRunning() )
        return;            // Avoid to process spurious timer events

    timer->Notify();
}
예제 #2
0
파일: timer.cpp 프로젝트: 3v1n0/wxWidgets
bool wxMotifTimerImpl::Start(int milliseconds, bool mode)
{
    if ( !wxTimerImpl::Start(milliseconds, mode) )
        return false;

    if ( gs_timers.find(this) == gs_timers.end() )
        gs_timers[this] = this;

    DoStart();

    return true;
}
예제 #3
0
파일: timer.cpp 프로젝트: gitrider/wxsj2
bool wxTimer::Start(int milliseconds, bool mode)
{
    Stop();

    (void)wxTimerBase::Start(milliseconds, mode);

    if (s_timers.find(this) == s_timers.end())
        s_timers[this] = this;

    m_id = XtAppAddTimeOut((XtAppContext) wxTheApp->GetAppContext(),
                            m_milli,
                            (XtTimerCallbackProc) wxTimerCallback,
                            (XtPointer) this);
    return true;
}
예제 #4
0
파일: timer.cpp 프로젝트: gitrider/wxsj2
void wxTimerCallback (wxTimer * timer)
{
  // Check to see if it's still on
  if (s_timers.find(timer) == s_timers.end())
    return;

  if (timer->m_id == 0)
    return;			// Avoid to process spurious timer events

  if (!timer->m_oneShot)
    timer->m_id = XtAppAddTimeOut((XtAppContext) wxTheApp->GetAppContext(),
                                  timer->m_milli,
                                  (XtTimerCallbackProc) wxTimerCallback,
                                  (XtPointer) timer);
  else
    timer->m_id = 0;

  timer->Notify();
}