def on_key_press_treeview_table(self, widget, event, anchor): """Catches Table key presses""" keyname = gtk.gdk.keyval_name(event.keyval) if event.state & gtk.gdk.CONTROL_MASK: self.curr_table_anchor = anchor self.dad.object_set_selection(self.curr_table_anchor) if keyname == "comma": if event.state & gtk.gdk.MOD1_MASK: self.table_row_delete() else: self.table_row_add() return True if keyname == "period": if event.state & gtk.gdk.MOD1_MASK: self.table_row_up() else: self.table_row_down() return True elif keyname == cons.STR_KEY_MENU: self.curr_table_anchor = anchor self.dad.object_set_selection(self.curr_table_anchor) menu_table = gtk.Menu() self.dad.menu_populate_popup(menu_table, menus.get_popup_menu_table(self.dad)) menu_table.popup(None, None, None, 3, event.time) return True return False
def on_mouse_button_clicked_treeview_table(self, widget, event, anchor): """Catches mouse buttons clicks""" self.curr_table_anchor = anchor self.dad.object_set_selection(self.curr_table_anchor) if event.button == 3: menu_table = gtk.Menu() self.dad.menu_populate_popup(menu_table, menus.get_popup_menu_table(self.dad)) menu_table.popup(None, None, None, event.button, event.time) return True return False