Gtk.BuildableIface

Fields

Name

Type

Access

Description

add_child

object

r

Adds a child. The type parameter can be used to differentiate the kind of child. GtkWidget implements this to add event controllers to the widget, GtkNotebook uses the type to distinguish between page labels (of type “page-label”) and normal children.

construct_child

object

r

Constructs a child of a buildable that has been specified as “constructor” in the UI definition. This can be used to reference a widget created in a <ui> tag which is outside of the normal Gtk.Builder UI definition hierarchy. A reference to the constructed object is returned and becomes owned by the caller.

custom_finished

object

r

Called for each custom tag handled by the buildable when the builder finishes parsing (see custom_tag_start)

custom_tag_end

object

r

Called for the end tag of each custom element that is handled by the buildable (see custom_tag_start).

custom_tag_start

object

r

Implement this if the buildable needs to parse content below <child>. To handle an element, the implementation must fill in the parser and user_data and return True. GtkWidget implements this to parse accessible attributes specified in <accessibility> elements. Note that user_data must be freed in custom_tag_end or custom_finished.

g_iface

GObject.TypeInterface

r

the parent class

get_id

object

r

The getter corresponding to set_id. Implement this if you implement set_id.

get_internal_child

object

r

Returns an internal child of a buildable. GtkDialog implements this to give access to its vbox, making it possible to add children to the vbox in a UI definition. Implement this if the buildable has internal children that may need to be accessed from a UI definition.

parser_finished

object

r

Called when a builder finishes the parsing of a UI definition. It is normally not necessary to implement this, unless you need to perform special cleanup actions. GtkWindow sets the GtkWidget:visible property here.

set_buildable_property

object

r

Sets a property of a buildable object. It is normally not necessary to implement this, GObject.Object.set_property() is used by default. GtkWindow implements this to delay showing itself (i.e. setting the [property`Gtk`.Widget:visible] property) until the whole interface is created.

set_id

object

r

Stores the id attribute given in the GtkBuilder UI definition. GtkWidget stores the name as object data. Implement this method if your object has some notion of “ID” and it makes sense to map the XML id attribute to it.

Methods

None

Details

class Gtk.BuildableIface

The GtkBuildableIface interface contains methods that are necessary to allow GtkBuilder to construct an object from a GtkBuilder UI definition.