#NEWLINE# @ CarbonEventHandler ( kEventClassWindow , kEventWindowResizeCompleted ) #NEWLINE# def _on_window_resize_completed( self , next_handler , ev , data ) : #NEWLINE# #INDENT# from pyglet import app #NEWLINE# if ( app . event_loop is not None ) : #NEWLINE# #INDENT# app . event_loop . exit_blocking ( ) #NEWLINE# #UNINDENT# rect = Rect ( ) #NEWLINE# carbon . GetWindowBounds ( self . _window , kWindowContentRgn , byref ( rect ) ) #NEWLINE# width = ( rect . right - rect . left ) #NEWLINE# height = ( rect . bottom - rect . top ) #NEWLINE# self . switch_to ( ) #NEWLINE# self . dispatch_event ( 'on_resize' , width , height ) #NEWLINE# self . dispatch_event ( 'on_expose' ) #NEWLINE# carbon . CallNextEventHandler ( next_handler , ev ) #NEWLINE# return noErr