Hi,
In my application, I am trying to create a new GtkPopover
and connect it to a GtkTextView
widget, where the GtkPopover
is shown when the user right-clicks over some selected text.
However, I am confused about the process of creating the content of the GtkPopover
. From the documentation of the widget, it seem to require a GMenuModel
object that defines the menu. In the process of researching how that works, I got myself confused about the following:
- How is a
GMenuModel
defined in the context ofGtkBuildable
. I know that that I can define aGtkMenu
by using the<menu>
definition. Is the same keyword used forGMenuModel
? - Since
GtkTextView
does not implementGtkActionable
, I can’t define a newGActionGroup
for the widget. On the other hand, it seems thatGMenuItem
s only allow for actions and I can’t connect to theiractivate
signal since they don’t have any signals. How can I useGMenuItem
s with widgets that don’t implementGtkActionable
? - All of this would be a lot simpler if I could convert a
GMenuItem
to aGtkMenuItem
. However, I can’t find a way to do so. Is there such a way?
Thank you for your help.