コード例 #1
0
 def start(self):
     try:
         self.stop()
         #ns_timer = \
         #	NSTimer.timerWithTimeInterval_target_selector_userInfo_repeats_(
         #		self._interval, self._target, '_ns_fire', None, self._repeat)
         ns_timer = \
           NSTimer.timerWithTimeInterval_target_selector_userInfo_repeats_(
               self._interval, trigger, 'fire:', None, self._repeat)
         self._ns_timer = ns_timer
         ns_timer_to_task[ns_timer] = self
         ns_run_loop = NSRunLoop.mainRunLoop()
         ns_run_loop.addTimer_forMode_(ns_timer, NSDefaultRunLoopMode)
         ns_run_loop.addTimer_forMode_(ns_timer, NSEventTrackingRunLoopMode)
         ns_run_loop.addTimer_forMode_(ns_timer, NSModalPanelRunLoopMode)
     except:
         logging.exception('pygui task start error')
コード例 #2
0
ファイル: spotify.py プロジェクト: szhu/spotify-hax
def loop():
    from Foundation import NSRunLoop
    NSRunLoop.mainRunLoop().run()
コード例 #3
0
ファイル: spotify.py プロジェクト: szhu/spotify-hax
def wait(time):
    from Foundation import NSDate
    from Foundation import NSRunLoop
    NSRunLoop.mainRunLoop().runBeforeDate_(NSDate.dateWithTimeIntervalSinceNow_(time))
コード例 #4
0
ファイル: urlreader.py プロジェクト: verbosus/mechanic-2
 def continue_runloop(self):
     NSRunLoop.mainRunLoop().runUntilDate_(
         NSDate.dateWithTimeIntervalSinceNow_(0.01))