def on_editable_button_press_event(self, widget, event): if event.button == 3: entries = [(gtk.STOCK_ADD, self.on_open_imagechooser, None, None), (gtk.STOCK_REMOVE, self.set_default_image, None, None)] utils.popup_menu(event, entries) else: self.on_open_imagechooser()
def on_treeview_press(self, treeview, event): pthinfo = treeview.get_path_at_pos(int(event.x), int(event.y)) if pthinfo is None: return if event.button == 3: entries = [ (gtk.STOCK_EDIT, self.on_buttonedit_clicked, None, None), (gtk.STOCK_REMOVE, self.on_buttonremove_clicked, None, None)] utils.popup_menu(event, entries)
def on_treeview_press(self, treeview, event): pthinfo = treeview.get_path_at_pos(int(event.x), int(event.y)) if pthinfo is None: return if event.button == 3: entries = [ (gtk.STOCK_EDIT, self.menuedit_activate, None, None), (gtk.STOCK_REMOVE, self.menuremove_activate, None, None), ("pedigree-detail", self.menupedigree_activate, None, None)] utils.popup_menu(event, entries)
def on_treeview_press(self, treeview, event): pthinfo = treeview.get_path_at_pos(int(event.x), int(event.y)) if pthinfo is None: return path, col, cellx, celly = pthinfo pigeon = treeview.get_model()[path][0] if event.button == 3: items = [(gtk.STOCK_INFO, self.on_show_details, (pigeon,), None), (gtk.STOCK_EDIT, self.on_edit_details, (pigeon,), None)] if pigeon.show: items.append((gtk.STOCK_JUMP_TO, self.on_goto_pigeon, (pigeon,), None)) utils.popup_menu(event, items) elif event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS: self.on_show_details(None, pigeon)
def on_button_press(self, box, event, detailed): parent = box.get_toplevel() entries = None if detailed: if not box.editable: return if event.button == 1: self._edit_pigeon_details(None, box.pigeon, box.child, box.get_sex(), parent) elif event.button == 3: entries = [(gtk.STOCK_EDIT, self._edit_pigeon_details, (box.pigeon, box.child, box.get_sex(), parent), None)] if box.pigeon is not None: entries.insert(0, (gtk.STOCK_INFO, self._show_pigeon_details, (box.pigeon, parent), None)) if not box.pigeon.get_visible(): entries.append((gtk.STOCK_CLEAR, self._clear_box, (box.pigeon, box.child), None)) entries.append((gtk.STOCK_REMOVE, self._remove_pigeon, (box.pigeon, box.child), None)) else: if box.textlayout.get_text() == "": return if event.button == 1: self._show_pigeon_details(None, box.pigeon, parent) elif event.button == 3: entries = [ (gtk.STOCK_INFO, self._show_pigeon_details, (box.pigeon, parent), None), (gtk.STOCK_JUMP_TO, self._select_pigeon, (box.pigeon, parent), None), ] if entries is not None: utils.popup_menu(event, entries) return True