#NEWLINE# def _dispatchEvent( sender , evt , useCap ) : #NEWLINE# #INDENT# if ( evt is None ) : #NEWLINE# #INDENT# evt = wnd ( ) . event #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# sender = get_main_frame ( ) . gobject_wrap ( sender ) #NEWLINE# evt = get_main_frame ( ) . gobject_wrap ( evt ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# listener = None #NEWLINE# curElem = sender #NEWLINE# cap = getCaptureElement ( ) #NEWLINE# listener = get_listener ( cap ) #NEWLINE# if ( cap and ( listener is not None ) ) : #NEWLINE# #INDENT# dispatchEvent ( evt , cap , listener ) #NEWLINE# evt . stopPropagation ( ) #NEWLINE# return #NEWLINE# #UNINDENT# while ( curElem and ( get_listener ( curElem ) is None ) ) : #NEWLINE# #INDENT# curElem = getParent ( curElem ) #NEWLINE# #UNINDENT# if ( curElem and ( getNodeType ( curElem ) != 1 ) ) : #NEWLINE# #INDENT# curElem = None #NEWLINE# #UNINDENT# listener = get_listener ( curElem ) #NEWLINE# if ( listener is not None ) : #NEWLINE# #INDENT# dispatchEvent ( evt , curElem , listener )