Allow GtkBuilder UI templates to specify a non-immediate ancestor as the parent
Currently, it seems that when specifying a widget template in a GtkBuilder UI file, the parent class specified must be the immediate parent of the template class, not some deeper ancestor of it.
For example, if my ExampleWidget
extends ExtendedGrid
, and ExtendedGrid
extends GtkGrid
, this generates a Gtk-Critical (Error building template class 'ExampleWidget' … Template parent type 'GtkGrid' does match instance parent type 'ExtendedGrid'
) when loaded:
<interface>
<template class="ExampleWidget" parent="GtkGrid">
....
</interface>
Whereas this does not:
<interface>
<template class="ExampleWidget" parent="ExtendedGrid">
....
</interface>
It would be useful to allow this since it means when using Glade, it would be possible to use custom widgets as a base class for templates without needing to a) generate a library containing the widget b) reinstall it every time it changes and c) ensure Glade knows about the right place to load it from.