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¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 isGtk.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 the
Gtk.Builder
format or run any extra routines at deserialization time.- add_child(builder, child, type)[source]¶
- Parameters:
builder (
Gtk.Builder
) – aGtk.Builder
child (
GObject.Object
) – child to add
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 objectname (
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
) – aGtk.Builder
child (
GObject.Object
orNone
) – child object orNone
for non-child tagstagname (
str
) – the name of the tagdata (
object
orNone
) – 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 objectchild (
GObject.Object
orNone
) – child object orNone
for non-child tagstagname (
str
) – name of tagdata (
object
orNone
) – 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
) – aGtk.Builder
used to construct this objectchild (
GObject.Object
orNone
) – child object orNone
for non-child tagstagname (
str
) – name of tag
- Returns:
True
if a object has a custom implementation,False
if 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
) – aGtk.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.
- get_name()[source]¶
- 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 the GtkBuilder UI definition used to construct the self.New in version 2.12.
- parser_finished(builder)[source]¶
- Parameters:
builder (
Gtk.Builder
) – aGtk.Builder
Called when the builder finishes the parsing of a GtkBuilder UI definition. Note that this will be called once for each time
Gtk.Builder.add_from_file
() orGtk.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
) – aGtk.Builder
name (
str
) – name of propertyvalue (
GObject.Value
) – value of property
Sets the property name name to value on the self object.
New in version 2.12.
- set_name(name)[source]¶
- 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
) – aGtk.Builder
child (
GObject.Object
) – child to add
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 objectname (
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
) – aGtk.Builder
child (
GObject.Object
orNone
) – child object orNone
for non-child tagstagname (
str
) – the name of the tagdata (
object
orNone
) – 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 objectchild (
GObject.Object
orNone
) – child object orNone
for non-child tagstagname (
str
) – name of tagdata (
object
orNone
) – 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
) – aGtk.Builder
used to construct this objectchild (
GObject.Object
orNone
) – child object orNone
for non-child tagstagname (
str
) – name of tag
- Returns:
True
if a object has a custom implementation,False
if 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
) – aGtk.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 the GtkBuilder UI definition used to construct the buildable.New in version 2.12.
- do_parser_finished(builder) virtual¶
- Parameters:
builder (
Gtk.Builder
) – aGtk.Builder
Called when the builder finishes the parsing of a GtkBuilder UI definition. Note that this will be called once for each time
Gtk.Builder.add_from_file
() orGtk.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
) – aGtk.Builder
name (
str
) – name of propertyvalue (
GObject.Value
) – value of property
Sets the property name name to value on the buildable object.
New in version 2.12.