From ebf569a160b41044d6e9c914b39c0833914d7e37 Mon Sep 17 00:00:00 2001 From: Chris Moore Date: Fri, 27 May 2011 23:56:33 -0700 Subject: [PATCH] Add keyboard shortcut Control-W to close the current tab. --- pyfpdb/fpdb.pyw | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index 898fe9a8..81d0045f 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -236,6 +236,9 @@ class fpdb: # This forces the widget to redraw itself. #nb.queue_draw_area(0,0,-1,-1) needed or not?? + def remove_current_tab(self, accel_group, acceleratable, keyval, modifier): + self.remove_tab(None, (self.nb, self.nb_tab_names[self.nb.get_current_page()])) + def delete_event(self, widget, event, data=None): return False @@ -927,6 +930,7 @@ class fpdb: # define keyboard shortcuts alt-1 through alt-0 for switching tabs for key in range(10): accel_group.connect_group(ord('%s' % key), gtk.gdk.MOD1_MASK, gtk.ACCEL_LOCKED, self.switch_to_tab) + accel_group.connect_group(ord('w'), gtk.gdk.CONTROL_MASK, gtk.ACCEL_LOCKED, self.remove_current_tab) uimanager.insert_action_group(actiongroup, 0) merge_id = uimanager.add_ui_from_string(fpdbmenu) -- 2.11.4.GIT