I’ve writing a Gnome window-switcher applet in PyGtk+ using menu items to represent the different applications running on the desktop. One thing I’d like to do is to activate the menu item under the cursor when I hover over the menubar. I can connect to the ‘enter-notify-event’ on the menu bar, but I don’t know what to when it is triggered.
So that’s my question, how can I make the submenus of the menu bar open when I hover over their parent items?
This should do the trick:
It will create a new event object, set it up using the
enter_eventfrom yourenter-notify-eventand then emit it on yourmenu.You can read more on events here:
http://www.pygtk.org/docs/pygtk/class-gdkevent.html