#NEWLINE# def button_press_event( self , widget , event ) : #NEWLINE# #INDENT# buttons = event . buttons ( ) #NEWLINE# ( x , y ) = ( event . x ( ) , event . y ( ) ) #NEWLINE# button = 0 #NEWLINE# if ( buttons & QtCore . Qt . LeftButton ) : #NEWLINE# #INDENT# button |= 1 #NEWLINE# #UNINDENT# if ( buttons & QtCore . Qt . MidButton ) : #NEWLINE# #INDENT# button |= 2 #NEWLINE# #UNINDENT# if ( buttons & QtCore . Qt . RightButton ) : #NEWLINE# #INDENT# button |= 4 #NEWLINE# #UNINDENT# self . logger . debug ( ( 'button down event at %dx%d, button=%x' % ( x , y , button ) ) ) #NEWLINE# ( data_x , data_y ) = self . get_data_xy ( y , y ) #NEWLINE# return self . make_ui_callback ( 'button-press' , button , data_x , data_y )