#NEWLINE# def _timer_proc( self , timer , data , in_events = True ) : #NEWLINE# #INDENT# allow_polling = True #NEWLINE# for window in windows : #NEWLINE# #INDENT# if ( window . _resizing is not None ) : #NEWLINE# #INDENT# allow_polling = False #NEWLINE# ( old_width , old_height ) = window . _resizing #NEWLINE# rect = types . Rect ( ) #NEWLINE# carbon . GetWindowBounds ( window . _window , constants . kWindowContentRgn , ctypes . byref ( rect ) ) #NEWLINE# width = ( rect . right - rect . left ) #NEWLINE# height = ( rect . bottom - rect . top ) #NEWLINE# if ( ( width != old_width ) or ( height != old_height ) ) : #NEWLINE# #INDENT# window . _resizing = ( width , height ) #NEWLINE# window . switch_to ( ) #NEWLINE# window . dispatch_event ( 'on_resize' , width , height ) #NEWLINE# #UNINDENT# #UNINDENT# if window . _dragging : #NEWLINE# #INDENT# allow_polling = False #NEWLINE# #UNINDENT# if window . _recreate_deferred : #NEWLINE# #INDENT# if in_events : #NEWLINE# #INDENT# carbon . QuitEventLoop ( self . _event_loop ) #NEWLINE# self . _force_idle = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# window . _recreate_immediate ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# sleep_time = self . idle ( ) #NEWLINE# if ( sleep_time is None ) : #NEWLINE# #INDENT# sleep_time = constants . kEventDurationForever #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( sleep_time < 0.01 ) and allow_polling and self . _allow_polling ) : #NEWLINE# #INDENT# if in_events : #NEWLINE# #INDENT# carbon . QuitEventLoop ( self . _event_loop ) #NEWLINE# #UNINDENT# self . _force_idle = True #NEWLINE# sleep_time = constants . kEventDurationForever #NEWLINE# #UNINDENT# #UNINDENT# carbon . SetEventLoopTimerNextFireTime ( timer , ctypes . c_double ( sleep_time ) )