After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733977 - No way of creating a widget for a menu model
No way of creating a widget for a menu model
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GtkApplication
3.13.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-07-30 13:01 UTC by Cosimo Cecchi
Modified: 2018-05-02 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Cosimo Cecchi 2014-07-30 13:01:57 UTC
In gnome-documents, we have an entry dropdown menu for search options, using a GtkPopover. To get a consistent look, and to keep the code simple, it makes a lot of sense to use GActions and a GMenu to model those options.
The problem is that currently GTK has no public API to create a widget for a GMenuModel; I was able to work this around by creating a GtkPopover and stealing its child, but it's not a very future-proof solution.

Instead, it would be best to have a public API to create an (opaque) widget foe a GMenuModel, basically exposing what happens inside gtk_popover_bind_model().
Comment 1 Matthias Clasen 2014-07-30 22:00:00 UTC
I think this calls for exporting the modelbutton widgetry that is used in the popover-from-model code, so you can construct this yourself instead of abusing both menu models and their popover conversion code.
Comment 2 Allison Karlitskaya (desrt) 2014-08-18 13:52:43 UTC
and that, in turn, calls for a new approach to GtkButton... which is where we've been for a couple of years now.
Comment 3 Cosimo Cecchi 2014-12-12 03:32:27 UTC
Matthias, do GtkPopoverMenu and GtkModelButton fill this gap?
Comment 4 Matthias Clasen 2014-12-13 14:04:39 UTC
not really, I'm afraid. popovermenu and modelbutton sidestep the issue by not using models altogether and just letting you construct action-backed popovers 'the normal way'
Comment 5 GNOME Infrastructure Team 2018-05-02 16:10:50 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/498.