Gtk.Buildable - Interfaces - Gtk 3.0 (original) (raw)
g GObject.GInterface GObject.GInterface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable
Implementations:
Gtk.Action, Gtk.ActionGroup, Gtk.CellArea, Gtk.EntryCompletion, Gtk.FileFilter, Gtk.IconFactory, Gtk.ListStore, Gtk.RecentFilter, Gtk.SizeGroup, Gtk.TextTagTable, Gtk.TreeStore, Gtk.TreeViewColumn, Gtk.UIManager, Gtk.Widget
Methods¶
add_child (builder, child, type) |
---|
construct_child (builder, name) |
custom_finished (builder, child, tagname, data) |
custom_tag_end (builder, child, tagname, data) |
custom_tag_start (builder, child, tagname) |
get_internal_child (builder, childname) |
get_name () |
parser_finished (builder) |
set_buildable_property (builder, name, value) |
set_name (name) |
Virtual Methods¶
do_add_child (builder, child, type) |
---|
do_construct_child (builder, name) |
do_custom_finished (builder, child, tagname, data) |
do_custom_tag_end (builder, child, tagname, data) |
do_custom_tag_start (builder, child, tagname) |
do_get_internal_child (builder, childname) |
do_get_name () |
do_parser_finished (builder) |
do_set_buildable_property (builder, name, value) |
do_set_name (name) |
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
class Gtk.Buildable¶
Bases:
Structure:
Gtk.Buildable allows objects to extend and customize their deserialization from GtkBuilder UI descriptions. The interface includes methods for setting names and properties of objects, parsing custom tags and constructing child objects.
The Gtk.Buildable 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 Gtk.Builder. 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 theGtk.Builder format or run any extra routines at deserialization time.
add_child(builder, child, type)[source]¶
Parameters:
- builder (Gtk.Builder) – a Gtk.Builder
- child (GObject.Object) – child to add
- type (str or None) – kind of child or None
Adds a child to self. type is an optional string describing how the child should be added.
New in version 2.12.
construct_child(builder, name)[source]¶
Parameters:
- builder (Gtk.Builder) – Gtk.Builder used to construct this object
- name (str) – name of child to construct
Returns:
the constructed child
Return type:
Constructs a child of self with the name name.
Gtk.Builder calls this function if a “constructor” has been specified in the UI definition.
New in version 2.12.
custom_finished(builder, child, tagname, data)[source]¶
Parameters:
- builder (Gtk.Builder) – a Gtk.Builder
- child (GObject.Object or None) – child object or None for non-child tags
- tagname (str) – the name of the tag
- data (object or None) – user data created in custom_tag_start
This is similar to Gtk.Buildable.parser_finished() but is called once for each custom tag handled by the self.
New in version 2.12.
custom_tag_end(builder, child, tagname, data)[source]¶
Parameters:
- builder (Gtk.Builder) – Gtk.Builder used to construct this object
- child (GObject.Object or None) – child object or None for non-child tags
- tagname (str) – name of tag
- data (object or None) – user data that will be passed in to parser functions
This is called at the end of each custom element handled by the buildable.
New in version 2.12.
custom_tag_start(builder, child, tagname)[source]¶
Parameters:
- builder (Gtk.Builder) – a Gtk.Builder used to construct this object
- child (GObject.Object or None) – child object or None for non-child tags
- tagname (str) – name of tag
Returns:
True if a object has a custom implementation, Falseif it doesn’t.
parser:
a GLib.MarkupParser to fill in
data:
return location for user data that will be passed in to parser functions
Return type:
(bool, parser: GLib.MarkupParser, data: object)
This is called for each unknown element under <child>
.
New in version 2.12.
get_internal_child(builder, childname)[source]¶
Parameters:
- builder (Gtk.Builder) – a Gtk.Builder
- childname (str) – name of child
Returns:
the internal child of the buildable object
Return type:
Get the internal child called childname of the self object.
New in version 2.12.
Returns:
the name set with Gtk.Buildable.set_name()
Return type:
Gets the name of the self object.
Gtk.Builder sets the name based on theGtkBuilder UI definitionused to construct the self.
New in version 2.12.
parser_finished(builder)[source]¶
Parameters:
builder (Gtk.Builder) – a Gtk.Builder
Called when the builder finishes the parsing of aGtkBuilder UI definition. Note that this will be called once for each timeGtk.Builder.add_from_file() or Gtk.Builder.add_from_string() is called on a builder.
New in version 2.12.
set_buildable_property(builder, name, value)[source]¶
Parameters:
- builder (Gtk.Builder) – a Gtk.Builder
- name (str) – name of property
- value (GObject.Value) – value of property
Sets the property name name to value on the self object.
New in version 2.12.
Parameters:
name (str) – name to set
Sets the name of the self object.
New in version 2.12.
do_add_child(builder, child, type) virtual¶
Parameters:
- builder (Gtk.Builder) – a Gtk.Builder
- child (GObject.Object) – child to add
- type (str or None) – kind of child or None
Adds a child to buildable. type is an optional string describing how the child should be added.
New in version 2.12.
do_construct_child(builder, name) virtual¶
Parameters:
- builder (Gtk.Builder) – Gtk.Builder used to construct this object
- name (str) – name of child to construct
Returns:
the constructed child
Return type:
Constructs a child of buildable with the name name.
Gtk.Builder calls this function if a “constructor” has been specified in the UI definition.
New in version 2.12.
do_custom_finished(builder, child, tagname, data) virtual¶
Parameters:
- builder (Gtk.Builder) – a Gtk.Builder
- child (GObject.Object or None) – child object or None for non-child tags
- tagname (str) – the name of the tag
- data (object or None) – user data created in custom_tag_start
This is similar to Gtk.Buildable.parser_finished() but is called once for each custom tag handled by the buildable.
New in version 2.12.
do_custom_tag_end(builder, child, tagname, data) virtual¶
Parameters:
- builder (Gtk.Builder) – Gtk.Builder used to construct this object
- child (GObject.Object or None) – child object or None for non-child tags
- tagname (str) – name of tag
- data (object or None) – user data that will be passed in to parser functions
This is called at the end of each custom element handled by the buildable.
New in version 2.12.
do_custom_tag_start(builder, child, tagname) virtual¶
Parameters:
- builder (Gtk.Builder) – a Gtk.Builder used to construct this object
- child (GObject.Object or None) – child object or None for non-child tags
- tagname (str) – name of tag
Returns:
True if a object has a custom implementation, Falseif it doesn’t.
parser:
a GLib.MarkupParser to fill in
data:
return location for user data that will be passed in to parser functions
Return type:
(bool, parser: GLib.MarkupParser, data: object)
This is called for each unknown element under <child>
.
New in version 2.12.
do_get_internal_child(builder, childname) virtual¶
Parameters:
- builder (Gtk.Builder) – a Gtk.Builder
- childname (str) – name of child
Returns:
the internal child of the buildable object
Return type:
Get the internal child called childname of the buildable object.
New in version 2.12.
do_get_name() virtual¶
Returns:
the name set with Gtk.Buildable.set_name()
Return type:
Gets the name of the buildable object.
Gtk.Builder sets the name based on theGtkBuilder UI definitionused to construct the buildable.
New in version 2.12.
do_parser_finished(builder) virtual¶
Parameters:
builder (Gtk.Builder) – a Gtk.Builder
Called when the builder finishes the parsing of aGtkBuilder UI definition. Note that this will be called once for each timeGtk.Builder.add_from_file() or Gtk.Builder.add_from_string() is called on a builder.
New in version 2.12.
do_set_buildable_property(builder, name, value) virtual¶
Parameters:
- builder (Gtk.Builder) – a Gtk.Builder
- name (str) – name of property
- value (GObject.Value) – value of property
Sets the property name name to value on the buildable object.
New in version 2.12.
do_set_name(name) virtual¶
Parameters:
name (str) – name to set
Sets the name of the buildable object.
New in version 2.12.