-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
- m_info->m_task.tmAddr = NewTimerUPP( MacTimerProc ) ;
-#else
- m_info->m_task.tmAddr = NewTimerProc( MacTimerProc ) ;
-#endif
- m_info->m_task.tmWakeUp = 0 ;
- m_info->m_task.tmReserved = 0 ;
- m_info->m_task.qType = 0 ;
- m_info->m_timer = this ;
- InsXTime((QElemPtr) &m_info->m_task ) ;
- PrimeTime( (QElemPtr) &m_info->m_task , m_milli ) ;
- return TRUE;
+ m_info->m_timer = this;
+ m_info->m_proc = NewEventLoopTimerUPP( &wxProcessTimer );
+
+ OSStatus err = InstallEventLoopTimer(
+ GetMainEventLoop(),
+ m_milli*kEventDurationMillisecond,
+ IsOneShot() ? 0 : m_milli * kEventDurationMillisecond,
+ m_info->m_proc,
+ this,
+ &m_info->m_timerRef );
+ verify_noerr( err );
+
+ return true;