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 682235 - gtkmenubutton: repurpose set_menu for GMenuModel
gtkmenubutton: repurpose set_menu for GMenuModel
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-08-20 09:33 UTC by Lars Karlitski
Modified: 2013-02-03 22:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkmenubutton: repurpose set_menu for GMenuModel (11.60 KB, patch)
2012-08-20 09:33 UTC, Lars Karlitski
none Details | Review
GtkMenuButton: rename _set_menu() to _set_popup() (17.41 KB, patch)
2012-08-20 21:04 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Lars Karlitski 2012-08-20 09:33:25 UTC
gtk_menu_button_set_menu takes a GtkMenu and gtk_menu_button_set_menu_model
takes a GMenuModel.

I think we should use the set_menu name for setting the menu model.  It's the
preferred (and encouraged) way to give the button a menu, so it should get the
more obvious name.  Also, setting the menu widget directly might be deprecated
at some point, in which case we'll lose the "good name" forever.
Comment 1 Lars Karlitski 2012-08-20 09:33:28 UTC
Created attachment 221796 [details] [review]
gtkmenubutton: repurpose set_menu for GMenuModel

Use gtk_menu_button_set_menu for setting a GMenuModel instead of a
GtkMenu on the button.  Introduce set_gtk_menu for setting the menu
widget directly.

Setting the menu widget directly will be discouraged (or even
deprecated) in the future.  The most obvious name should be used for the
common case of setting a menu model.
Comment 2 Allison Karlitskaya (desrt) 2012-08-20 20:47:22 UTC
Plan: for today's release we'll introduce a new API (_set_popup()) and deprecate the _set_menu() API (so that people can move).  It's far too close to the release to just rip it out.

Later, we'll take out the _set_menu() API and rename _set_menu_model() to it.
Comment 3 Allison Karlitskaya (desrt) 2012-08-20 21:04:15 UTC
Created attachment 221918 [details] [review]
GtkMenuButton: rename _set_menu() to _set_popup()

It's too close to the release so we'll keep _set_menu() around, but
deprecate it, pointing to the new API.  It will be removed (and the name
reused) before the 3.6.0 release.
Comment 4 Matthias Clasen 2012-08-20 21:11:25 UTC
Review of attachment 221918 [details] [review]:

Looks fine to me
Comment 5 Allison Karlitskaya (desrt) 2012-08-20 21:43:52 UTC
Comment on attachment 221918 [details] [review]
GtkMenuButton: rename _set_menu() to _set_popup()

Attachment 221918 [details] pushed as 0244dc8 - GtkMenuButton: rename _set_menu() to _set_popup()