Widget.disposeTemplate

void disposeTemplate(gobject.types.GType widgetType)

Clears the template children for the given widget.

This function is the opposite of [gtk.widget.Widget.initTemplate], and it is used to clear all the template children from a widget instance. If you bound a template child to a field in the instance structure, or in the instance private data structure, the field will be set to NULL after this function returns.

You should call this function inside the GObjectClass.dispose() implementation of any widget that called [gtk.widget.Widget.initTemplate]. Typically, you will want to call this function last, right before chaining up to the parent type's dispose implementation, e.g.

static void
some_widget_dispose (GObject *gobject)
{
 SomeWidget *self = SOME_WIDGET (gobject);

 // Clear the template data for SomeWidget
 gtk_widget_dispose_template (GTK_WIDGET (self), SOME_TYPE_WIDGET);

 G_OBJECT_CLASS (some_widget_parent_class)->dispose (gobject);
}

Parameters

widgetTypethe type of the widget to finalize the template for