@@ -11,12 +11,15 @@ def bundle_path(subpath=None, rsrc=None, fmwk=None):
1111 return join (bundle , subpath )
1212 return bundle
1313
14- from Foundation import NSTimer
14+ from Foundation import NSTimer , NSRunLoop , NSRunLoopCommonModes
1515def set_timeout (target , sel , delay , info = None , repeat = False ):
16- return NSTimer .scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_ (delay , target , sel , info , repeat )
16+ timer = NSTimer .timerWithTimeInterval_target_selector_userInfo_repeats_ (delay , target , sel , info , repeat )
17+ NSRunLoop .mainRunLoop ().addTimer_forMode_ (timer , NSRunLoopCommonModes )
18+ return timer
1719
1820def next_tick (target , sel ):
19- return NSTimer .scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_ (0 , target , sel , None , False )
21+ timer = NSTimer .timerWithTimeInterval_target_selector_userInfo_repeats_ (0 , target , sel , None , False )
22+ NSRunLoop .mainRunLoop ().addTimer_forMode_ (timer , NSRunLoopCommonModes )
2023
2124from .document import PlotDeviceDocument , PythonScriptDocument , ScriptController
2225from .app import PlotDeviceAppDelegate
0 commit comments