GNOME Bugzilla – Bug 688205
Add new element <template> and gtk_builder_expose_object() function
Last modified: 2014-04-23 19:00:02 UTC
Created attachment 228822 [details] [review] Proposed implementation of gtk_builder_expose_object() and <template> element parsing From the new docs... gtk_builder_expose_object: Adds object to a pool of objects external to the objects built by builder. Objects exposed in this pool can be referred to by xml fragments by specifying the "external-object" boolean attribute. To make this function even more useful a new special entry point element <template> is defined. It is similar to <object> with the only difference it can only be defined as a toplevel element (that is it has to be a child of <interface>) and its id has to reference an external object exposed with this function. This way you can change properties and even add children to an external object using builder and not just reference it.
*** Bug 447972 has been marked as a duplicate of this bug. ***
More information can be found in my blog post http://blogs.gnome.org/xjuan/2012/11/12/gtkbuilder-and-external-objects/ and my development branch git checkout -b composite-templates origin/composite-templates
Created attachment 229090 [details] [review] Proposed implementation of gtk_builder_expose_object() and <template> element parsing Same as the other patch but objects are exposed to the same namespace as objects built by builder
> gboolean gtk_builder_expose_object (); > That function should always succeed, nobody is ever gonna check for failure. Make the failure case a g_return_if_fail(). If people want to avoid that, they can check that gtk_builder_get_object(name) == NULL before calling gtk_builder_expose_object().
Can you split this up and provide a separate patch for gtk_builder_expose_object ?
Created attachment 231182 [details] [review] gtk_builder_expose_object() implementation
Created attachment 231184 [details] [review] <external-object> tag implemention
Comment on attachment 231182 [details] [review] gtk_builder_expose_object() implementation That one looks nice. We should commit it before people do more bikeshedding on it.
Comment on attachment 231182 [details] [review] gtk_builder_expose_object() implementation Ok good, its in master!
Created attachment 231877 [details] [review] gtk_builder_expose_object() gtk3-demo example This adds a new example to gtk3-demo, it just creates a dialog with the main window as its transient parent.
Created attachment 231914 [details] [review] gtk_builder_expose_object() gtk3-demo example
Created attachment 231915 [details] [review] <external-object> tag gtk3-demo example