#NEWLINE# def _install_event_handler( self , func ) : #NEWLINE# #INDENT# if self . _fullscreen : #NEWLINE# #INDENT# target = carbon . GetApplicationEventTarget ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# target = carbon . GetWindowEventTarget ( event_kind . _window ) #NEWLINE# #UNINDENT# for ( event_class , event_kind ) in func . _platform_event_data : #NEWLINE# #INDENT# proc = EventHandlerProcPtr ( func ) #NEWLINE# self . _carbon_event_handlers . append ( proc ) #NEWLINE# upp = carbon . NewEventHandlerUPP ( proc ) #NEWLINE# types = EventTypeSpec ( ) #NEWLINE# types . eventClass = event_class #NEWLINE# types . eventKind = event_kind #NEWLINE# handler_ref = EventHandlerRef ( ) #NEWLINE# carbon . InstallEventHandler ( target , upp , 1 , byref ( types ) , c_void_p ( ) , byref ( handler_ref ) ) #NEWLINE# self . _carbon_event_handler_refs . append ( handler_ref )