Registering a MenuItem for keypress events

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Registering a MenuItem for keypress events

Fabrice DELENTE-4
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
_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/