[pygtk] keyboard "arrows"; howto add them to an application.

steven howe howe.steven at gmail.com
Thu Aug 10 02:02:56 WST 2006


Hello,
I've just walked throught he ui manager example and have tried adding a few
things. An 'Edit/Delete', 'Edit/Last' and 'Edit/Next'.
The action entries look like:
    ('Delete', gtk.STOCK_DELETE, 'Delete', 'Delete', 'Delete selection',
self.edit_delete_cb )
    ('Last', gtk.STOCK_GO_BACK, 'Last', 'Left', 'Last Image',
self.previous_image_cb)
     ('Next', gtk.STOCK_GO_FORWARD, 'Next',  'Right', 'Next Image',
self.next_image_cb)

Note that 'Delete' has no modifier key.

Now when I start the app I get a window, menubar and toolbar.The delete key
works. Hit delete and my dumby self.edit_delete_cb reports the event. The
'Last' and 'Next' do not work. They are in the menu and toolbar, but the
keys themself do nothing. I have used gtk.accelerator_parse( "Next" ) and
gtk.accelerator_parse( "Delete" ) to get the keyval and modifier mask of the
accelerator. These are:
   (65366, <flags 0 of type GdkModifierType>)
   (65535, <flags 0 of type GdkModifierType>)

Looking up the stock keys for delete, open and go-forward, I see
gtk.stock_lookup('gtk-delete')  ->> ('gtk-delete', '_Delete', <flags 0 of
type GdkModifierType>, 0, 'gtk20')
gtk.stock_lookup('gtk-open') ->> ('gtk-open', '_Open', <flags
GDK_CONTROL_MASK of type GdkModifierType>, 111, 'gtk20')
gtk.stock_lookup('gtk-go-forward') ->> ('gtk-go-forward', '_Forward', <flags
0 of type GdkModifierType>, 0, 'gtk20')

Delete has no stock keyboard action. My action group entry seem to work; it
set one. Note that go-forward and go-back don't have a keyboard entry
either. My action group entries set them, but they don't work. How can I fix
this?

Thanks in advance

Steven Howe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20060809/074426d1/at=
tachment.htm


More information about the pygtk mailing list