GNOME Bugzilla – Bug 757544
GtkHeaderBar subclass template and <child type="title"> does not work
Last modified: 2015-11-03 22:53:23 UTC
If you inherit from GtkHeaderBar and use a template to layout the UI, the <child type="title"> will be ignored by a call to gtk_header_bar_set_custom_title() after the object instantiation. This was verified with a printf() in gtk_header_bar_set_custom_title() which saw a valid pointer initially during buildable creation, and then a (nil) afterwards. Presumably from the G_PARAM_CONSTRUCT (although I have not verified).
Try <child type="titlebar">
Oh, I guess I misunderstood - an example would clarify.
Created attachment 314768 [details] example Quick example of the in progress .ui file
Created attachment 314773 [details] [review] remove G_PARAM_CONSTRUCT from :custom-title Quick patch to remove the construct param for custom-title. I'm not sure why it was set to construct, since it is not used in gtk_header_bar_new(). This fixes my issue.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.