Am Freitag, 26. Januar 2007 09:49 schrieb Richard Taylor: > Hi > > I have a Window that has a number of widgets placed in it, including a > TreeView, a Frame (containing more widgets), buttons etc. >
Hi, does this help you? http://www.pygtk.org/pygtk2tutorial/sec-WidgetAccelerators.html 18.3. Widget Accelerators The following methods: widget.add_accelerator(accel_signal, accel_group, accel_key, accel_mods, accel_flags) widget.remove_accelerator(accel_group, accel_key, accel_mods) add and remove accelerators from a gtk.AcceleratorGroup that must be attached to the top level widget to handle the accelerators. The accel_signal is a signal that is valid for the widget to emit. The accel_key is a keyboard key to use as the accelerator. The accel_mods are modifiers to add to the accel_key (e.g. Shift, Control, etc.): SHIFT_MASK LOCK_MASK CONTROL_MASK MOD1_MASK MOD2_MASK MOD3_MASK MOD4_MASK MOD5_MASK BUTTON1_MASK BUTTON2_MASK BUTTON3_MASK BUTTON4_MASK BUTTON5_MASK RELEASE_MASK The accel_flags set options about how the accelerator information is displayed. Valid values are: ACCEL_VISIBLE # display the accelerator key in the widget display ACCEL_LOCKED # do not allow the accelerator display to change An accelerator group is created by the function: accel_group = gtk.AccelGroup() The accel_group is attached to a top level widget with the following method: window.add_accel_group(accel_group) An example of adding an accelerator: menu_item.add_accelerator("activate", accel_group, ord('Q'), gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE) _______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
