예제 #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
 def continue_runloop(self):
     NSRunLoop.mainRunLoop().runUntilDate_(
         NSDate.dateWithTimeIntervalSinceNow_(0.01))