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 766402 - GtkBuilder's add_objects_* API refuses to return <menu> objects
GtkBuilder's add_objects_* API refuses to return <menu> objects
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GtkBuilder
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: GtkBuilder maintainers
GtkBuilder maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-13 22:56 UTC by Kai Willadsen
Modified: 2018-05-02 17:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (2.32 KB, patch)
2016-05-13 22:56 UTC, Kai Willadsen
needs-work Details | Review
Simple python test case (444 bytes, text/x-python)
2016-05-13 22:57 UTC, Kai Willadsen
  Details

Description Kai Willadsen 2016-05-13 22:56:42 UTC
Created attachment 327833 [details] [review]
Proposed patch

When loading a GtkBuilder UI definition, the APIs that take a list of objects to load ignore <menu> top-levels. Given that existing examples in GTK+ use this construction all the time, this seems like an oversight.

The attached patch fixes the problem and seems reasonable to me. However, I can't be certain that it isn't breaking assumptions elsewhere.
Comment 1 Kai Willadsen 2016-05-13 22:57:50 UTC
Created attachment 327834 [details]
Simple python test case
Comment 2 Matthias Clasen 2016-05-15 20:15:25 UTC
Review of attachment 327833 [details] [review]:

Thanks for the patch! It patch succeeds in so far as menus are now added. But it adds menus unconditionally. I would expect menus to be restricted to the specified names, just as other objects are.
Comment 3 Kai Willadsen 2016-06-25 23:07:19 UTC
I put in a bit of time to see whether I could get menus to be selectively added, and have given up. I can't see how to handle this without duplicating half of `parse_object`, and if I'm honest, I'm just not going to put in the necessary hours to get familiar enough with the GtkBuilder parser state to fix this.

I'd like to suggest that if no one else is likely to look at this, then the unconditional adding of menus from my patch above is less surprising to the API user than not having their requested items added at all. However, I can understand if you don't feel the same.
Comment 4 Matthias Clasen 2018-02-10 05:14:26 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 5 Kai Willadsen 2018-02-10 20:12:40 UTC
This is still an issue.
Comment 6 GNOME Infrastructure Team 2018-05-02 17:09:37 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/625.