gtk.buildable_mixin

Module for [Buildable] interface mixin

Templates 2

tmplBuildableT()

GtkBuildable allows objects to extend and customize their deserialization from [GtkBuilder UI descriptions][BUILDER-UI]. The interface includes methods for setting names and properties of objects, parsing custom tags and constructing child objects.

The GtkBuildable interface is implemented by all widgets and many of the non-widget objects that are provided by GTK+. The main user of this interface is #GtkBuilder. There should be very little need for applications to call any of these functions directly.

An object only needs to implement this interface if it needs to extend the #GtkBuilder format or run any extra routines at deserialization time.

Functions
void addChild(gtk.builder.Builder builder, gobject.object.ObjectWrap child, string type = null)

Adds a child to buildable. type is an optional string describing how the child should be added.

Parameters

buildera #GtkBuilder
childchild to add
typekind of child or null
gobject.object.ObjectWrap constructChild(gtk.builder.Builder builder, string name)

Constructs a child of buildable with the name name.

#GtkBuilder calls this function if a “constructor” has been specified in the UI definition.

Parameters

builder#GtkBuilder used to construct this object
namename of child to construct

Returns

the constructed child
void customFinished(gtk.builder.Builder builder, gobject.object.ObjectWrap child, string tagname, void * data = null)

This is similar to [gtk.buildable.Buildable.parserFinished] but is called once for each custom tag handled by the buildable.

Parameters

buildera #GtkBuilder
childchild object or null for non-child tags
tagnamethe name of the tag
datauser data created in custom_tag_start
bool customTagStart(gtk.builder.Builder builder, gobject.object.ObjectWrap child, string tagname, out glib.types.MarkupParser parser, out void * data)

This is called for each unknown element under <child>.

Parameters

buildera #GtkBuilder used to construct this object
childchild object or null for non-child tags
tagnamename of tag
parsera #GMarkupParser to fill in
datareturn location for user data that will be passed in to parser functions

Returns

true if a object has a custom implementation, false

if it doesn't.

gobject.object.ObjectWrap getInternalChild(gtk.builder.Builder builder, string childname)

Get the internal child called childname of the buildable object.

Parameters

buildera #GtkBuilder
childnamename of child

Returns

the internal child of the buildable object
string getName()

Gets the name of the buildable object.

#GtkBuilder sets the name based on the [GtkBuilder UI definition][BUILDER-UI] used to construct the buildable.

Returns

the name set with [gtk.buildable.Buildable.setName]
void parserFinished(gtk.builder.Builder builder)

Called when the builder finishes the parsing of a [GtkBuilder UI definition][BUILDER-UI]. Note that this will be called once for each time [gtk.builder.Builder.addFromFile] or [gtk.builder.Builder.addFromString] is called on a builder.

Parameters

buildera #GtkBuilder
void setBuildableProperty(gtk.builder.Builder builder, string name, gobject.value.Value value)

Sets the property name name to value on the buildable object.

Parameters

buildera #GtkBuilder
namename of property
valuevalue of property
void setName(string name)

Sets the name of the buildable object.

Parameters

namename to set
tmplBuildableGidBuilderT()