2.6 <GtkBuildable>

Interface: <GtkBuildable>

Allows objects to extend and customize deserialization from ui files.

The <GtkBuildable> interface includes methods for setting names and properties of objects, parsing custom tags and constructing child objects.

It 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> XML format or run any extra routines at deserialization time.

Procedures

Method: buildable:get-buildable-id self ⇒ %return
Method: get-buildable-id self ⇒ %return

Gets the ID of the self object.

<GtkBuilder> sets the name based on the ID attribute of the <object> tag used to construct the self.

self

Passed: a <GtkBuildable>.

a <GtkBuildable>

%return

Returned: a string, or #f.

the ID of the buildable object

Virtual methods

Virtual method: buildable:do-add-child implementor self builder child [type]

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

To override it in a new class, give register-type #:vfuncs `((add-child . ,procedure)). The procedure is called as (procedure self builder child type).

implementor

Passed: the class whose implementation to call: a class that implements <GtkBuildable>, or its GType number.

self

Passed: a <GtkBuildable>.

a <GtkBuildable>

builder

Passed: a <GtkBuilder>.

a <GtkBuilder>

child

Passed: a <GObject>.

child to add

type

Passed, or left out: a string, or #f.

kind of child or #f

Virtual method: buildable:do-custom-finished implementor self builder child tagname [data]

Similar to gtk_buildable_parser_finished() but is called once for each custom tag handled by the self.

To override it in a new class, give register-type #:vfuncs `((custom-finished . ,procedure)). The procedure is called as (procedure self builder child tagname data).

implementor

Passed: the class whose implementation to call: a class that implements <GtkBuildable>, or its GType number.

self

Passed: a <GtkBuildable>.

a <GtkBuildable>

builder

Passed: a <GtkBuilder>.

a <GtkBuilder>

child

Passed: a <GObject>, or #f.

child object or #f for non-child tags

tagname

Passed: a string.

the name of the tag

data

Passed, or left out: a foreign pointer, or a bytevector, or #f.

user data created in custom_tag_start

Virtual method: buildable:do-custom-tag-end implementor self builder child tagname [data]

Called at the end of each custom element handled by the buildable.

To override it in a new class, give register-type #:vfuncs `((custom-tag-end . ,procedure)). The procedure is called as (procedure self builder child tagname data).

implementor

Passed: the class whose implementation to call: a class that implements <GtkBuildable>, or its GType number.

self

Passed: a <GtkBuildable>.

A <GtkBuildable>

builder

Passed: a <GtkBuilder>.

<GtkBuilder> used to construct this object

child

Passed: a <GObject>, or #f.

child object or #f for non-child tags

tagname

Passed: a string.

name of tag

data

Passed, or left out: a foreign pointer, or a bytevector, or #f.

user data that will be passed in to parser functions

Virtual method: buildable:do-get-id implementor self ⇒ %return

The getter corresponding to set-id. Implement this if you implement set-id.

To override it in a new class, give register-type #:vfuncs `((get-id . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GtkBuildable>, or its GType number.

self

Passed: a <GtkBuildable>.

%return

Returned: a string.

Virtual method: buildable:do-get-internal-child implementor self builder childname ⇒ %return

Retrieves the internal child called childname of the self object.

To override it in a new class, give register-type #:vfuncs `((get-internal-child . ,procedure)). The procedure is called as (procedure self builder childname) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GtkBuildable>, or its GType number.

self

Passed: a <GtkBuildable>.

a <GtkBuildable>

builder

Passed: a <GtkBuilder>.

a <GtkBuilder>

childname

Passed: a string.

name of child

%return

Returned: a <GObject>.

the internal child of the buildable object

Virtual method: buildable:do-parser-finished implementor self builder

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 widget:visible property here.

To override it in a new class, give register-type #:vfuncs `((parser-finished . ,procedure)). The procedure is called as (procedure self builder).

implementor

Passed: the class whose implementation to call: a class that implements <GtkBuildable>, or its GType number.

self

Passed: a <GtkBuildable>.

builder

Passed: a <GtkBuilder>.

Virtual method: buildable:do-set-buildable-property implementor self builder name value

Sets a property of a buildable object. It is normally not necessary to implement this, object:set-property is used by default. <GtkWindow> implements this to delay showing itself (i.e. setting the widget:visible property) until the whole interface is created.

To override it in a new class, give register-type #:vfuncs `((set-buildable-property . ,procedure)). The procedure is called as (procedure self builder name value).

implementor

Passed: the class whose implementation to call: a class that implements <GtkBuildable>, or its GType number.

self

Passed: a <GtkBuildable>.

builder

Passed: a <GtkBuilder>.

name

Passed: a string.

value

Passed: a <GValue>.

Virtual method: buildable:do-set-id implementor self id

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.

To override it in a new class, give register-type #:vfuncs `((set-id . ,procedure)). The procedure is called as (procedure self id).

implementor

Passed: the class whose implementation to call: a class that implements <GtkBuildable>, or its GType number.

self

Passed: a <GtkBuildable>.

id

Passed: a string.