GtkPopoverMenu as a GtkMenu replacement
I recently had a look at the Gtk4 docs to figure out what it'd take to port Horizon EDA to Gtk4 once it's widely available and was quite surprised by the removal of the GtkMenu APIs. If I didn't overlook something GtkPopoverMenu makes things significantly harder than they were with GtkMenu:
In some places, all I need is a context menu with a few items. I don't quite see the benefit of using actions rather than connecting directly to the activate
signal of a GtkMenuItem.
Since the application uses its own shortcut handling, I pack a GtkBox into the GtkMenuItem to show keybindings. I don't see that this is possible with the new GtkPopoverMenu.
Menus are also use for clarifying the selection when clicking somewhere matches more than one item:
There would be multiple issues doing this with a GtkPopoverMenu :
- By its very nature, this menu is populated dynamically. Adding new actions on-the-fly just to get items into the menu doesn't feel like doing it the right way.
- To make it clear which objects on screen correspond to the items in the menu, I connect to the select/deselect signals of GtkMenuItem and highlight the appropriate item. As far as I can tell, there's no such thing with GtkPopoverMenu.