gtk.buildable_mixin
Module for [Buildable] interface mixin
Templates 2
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.
Adds a child to buildable. type is an optional string describing how the child should be added.
Parameters
builder | a #GtkBuilder |
child | child to add |
type | kind of child or null |
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 |
name | name of child to construct |
Returns
This is similar to [gtk.buildable.Buildable.parserFinished] but is called once for each custom tag handled by the buildable.
Parameters
builder | a #GtkBuilder |
child | child object or null for non-child tags |
tagname | the name of the tag |
data | user data created in custom_tag_start |
This is called for each unknown element under <child>.
Parameters
builder | a #GtkBuilder used to construct this object |
child | child object or null for non-child tags |
tagname | name of tag |
parser | a #GMarkupParser to fill in |
data | return location for user data that will be passed in to parser functions |
Returns
if it doesn't.
Get the internal child called childname of the buildable object.
Parameters
builder | a #GtkBuilder |
childname | name of child |
Returns
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
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
builder | a #GtkBuilder |
Sets the property name name to value on the buildable object.
Parameters
builder | a #GtkBuilder |
name | name of property |
value | value of property |
Sets the name of the buildable object.
Parameters
name | name to set |