Below are two questions on the same component:
- Which signal is triggered when the mouse passes over a
Gio.MenuItem
? - How to implement a tooltip for
Gio.MenuItem
?
Below are two questions on the same component:
Gio.MenuItem
?Gio.MenuItem
?Gio.MenuItem
is a direct descendent from GObject.GObject
(See https://lazka.github.io/pgi-docs/Gio-2.0/classes/MenuItem.html). It does not have any signals itself, and only receives a notify
signal via its descent from GObject.
As Gio.MenuItem
is not a widget, it does not receive any signals from the GUI. It only represents data (opaque data at that).
I suspect you want Gtk.MenuItem
, which is the visual component.
EDIT It seems the widget you are after is Gtk.PopoverMenu
. Just to be clear, Gio.MenuItem is not a visible item, which is why I replied as above. Gtk.PopoverMenu is a widget (widget = a visible item).
PopoverMenu
is the visible widget, and you can see how it fits together with other widgets. It inherits from Popover
, which inherits from Gtk.Bin
, Gtk.Container
and finally from Gtk.Widget
.
So, you have all the signals from those widgets, but those are for the 'complete' Gtk.PopoverMenu
, not for the individual items.
According to this definition, the individual items are Gtk.ModelButton
s, so you might be able to access them that way.
The solution to get this was much further than I thought. I always suspected that the Devhelp's menu could not be built using GtkPopoverMenu because my OS uses gtk 3.14. The solution involves a totally new concept of running an application, proposed by Gtk.Application interface and the Gtk.Action features. These "new" concepts can be studied in the following places.
http://python-gtk-3-tutorial.readthedocs.io/en/latest/application.html?highlight=Gtk.Application
https://wiki.gnome.org/HowDoI/GtkApplication
https://github.com/Programmica/python-gtk3-tutorial/blob/master/_examples/application.py
Apparently tooltip features are not available for this menu type.