#NEWLINE# def _popEventHandlers( ctrl ) : #NEWLINE# #INDENT# ' Pop any event handlers that have been pushed on to a window and its\n        children.\n    ' #NEWLINE# while ( ctrl is not ctrl . GetEventHandler ( ) ) : #NEWLINE# #INDENT# handler = ctrl . GetEventHandler ( ) #NEWLINE# if isinstance ( handler , EventHandlerWrapper ) : #NEWLINE# #INDENT# ctrl . PopEventHandler ( True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# for child in ctrl . GetChildren ( ) : #NEWLINE# #INDENT# _popEventHandlers ( child )