GNOME Bugzilla – Bug 766402
GtkBuilder's add_objects_* API refuses to return <menu> objects
Last modified: 2018-05-02 17:09:37 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.
Created attachment 327834 [details] Simple python test case
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.
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.
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.
This is still an issue.
-- 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.