[pygtk] Registering a MenuItem for keypress events

Fabrice Delente delentef at gmail.com
Thu Mar 14 23:02:48 WST 2013


Hello.

I'd like to be able to connect a MenuItem to a callback when a key is
pressed on this item menu.

I have tried this:

  item.connect("key_press_event", callback)
  item.add_events(gtk.gdk.KEY_PRESS)

but nothing happens when I press a key.

Is it possible to do? If yes, how?

Thanks.

--
F. Delente


More information about the pygtk mailing list