def on_button_release(self, widget, event):
     if not point_in(self.get_allocation(), int(event.x), int(event.y)):
         self.pressed = False
         return
     exhibit = self.exhibits[self.cursor]
     if (exhibit.package_names or exhibit.click_url) and self.pressed:
         self.emit("show-exhibits-clicked", exhibit)
     self.pressed = False
예제 #2
0
 def on_button_release(self, widget, event):
     if not point_in(self.get_allocation(),
                     int(event.x), int(event.y)):
         self.pressed = False
         return
     exhibit = self.exhibits[self.cursor]
     if (exhibit.package_names or exhibit.click_url) and self.pressed:
         self.emit("show-exhibits-clicked", exhibit)
     self.pressed = False
 def index_at(self, px, py):
     #wa = self.widget.get_allocation()
     x, y = self.get_position()  # layout allocation
     (_, index, k) = self.xy_to_index((px - x) * _PS, (py - y) * _PS)
     return point_in(self.allocation, px, py), index + k
예제 #4
0
 def index_at(self, px, py):
     #wa = self.widget.get_allocation()
     x, y = self.get_position() # layout allocation
     (_, index, k) = self.xy_to_index((px-x)*_PS, (py-y)*_PS)
     return point_in(self.allocation, px, py), index + k
예제 #5
0
 def on_button_press(self, widget, event):
     if point_in(self.get_allocation(),
                 int(event.x), int(event.y)):
         self.pressed = True
 def on_button_press(self, widget, event):
     if point_in(self.get_allocation(), int(event.x), int(event.y)):
         self.pressed = True