Exemplo n.º 1
0
 def click_cb(self, window, event):
     applet = self.get_applet_at_coords(event.x, event.y)
     if applet is not None:
         if event.button == MOUSE_BUTTON_RIGHT:
             applet.show_menu()
         else:
             x = event.x - applet.get_position()[0]
             y = event.y - applet.get_position()[1]
             applet.emit("click", x, y)
     elif event.button == MOUSE_BUTTON_RIGHT:
         self.menu.popup(None, None, None, event.button, event.get_time())
Exemplo n.º 2
0
 def click_cb(self, window, event):
     applet = self.get_applet_at_coords(event.x, event.y)
     if applet is not None:
         if event.button == MOUSE_BUTTON_RIGHT:
             applet.show_menu()
         else:
             x = event.x - applet.get_position()[0]
             y = event.y - applet.get_position()[1]
             applet.emit('click', x, y)
     elif event.button == MOUSE_BUTTON_RIGHT:
         self.menu.popup(None, None, None, event.button, event.get_time())
Exemplo n.º 3
0
 def scroll_cb(self, window, event):
     applet = self.get_applet_at_coords(event.x, event.y)
     if applet:
         offset_x, offset_y = applet.get_position()
         applet.emit("scroll", event.x - offset_x, event.y - offset_y, event.direction)
Exemplo n.º 4
0
 def mouse_leave_cb(self, window, event):
     applet = self.get_applet_at_coords(event.x, event.y)
     if applet:
         offset_x, offset_y = applet.get_position()
         applet.emit("mouse-leave", event.x - offset_x, event.y - offset_y)
Exemplo n.º 5
0
 def scroll_cb(self, window, event):
     applet = self.get_applet_at_coords(event.x, event.y)
     if applet:
         offset_x, offset_y = applet.get_position()
         applet.emit('scroll', event.x - offset_x, event.y - offset_y,
                     event.direction)
Exemplo n.º 6
0
 def mouse_leave_cb(self, window, event):
     applet = self.get_applet_at_coords(event.x, event.y)
     if applet:
         offset_x, offset_y = applet.get_position()
         applet.emit('mouse-leave', event.x - offset_x, event.y - offset_y)