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
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
def on_button_press(self, widget, event): if point_in(self.get_allocation(), int(event.x), int(event.y)): self.pressed = True