Gtk.Buildable¶
- Implementations:
Gtk.CellArea
,Gtk.ConstraintLayout
,Gtk.EntryCompletion
,Gtk.FileFilter
,Gtk.ListStore
,Gtk.MultiFilter
,Gtk.MultiSorter
,Gtk.ShortcutController
,Gtk.SizeGroup
,Gtk.StringList
,Gtk.TextTagTable
,Gtk.TreeStore
,Gtk.TreeViewColumn
,Gtk.Widget
Methods¶
Virtual Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Gtk.Buildable¶
- Bases:
- Structure:
GtkBuildable
allows objects to extend and customize their deserialization from ui files.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 [class`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 the
GtkBuilder
XML format or run any extra routines at deserialization time.- get_buildable_id()[source]¶
-
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.
- do_add_child(builder, child, type) virtual¶
- Parameters:
builder (
Gtk.Builder
) – aGtkBuilder
child (
GObject.Object
) – child to add
Adds a child to buildable. type is an optional string describing how the child should be added.
- do_custom_finished(builder, child, tagname, data) virtual¶
- Parameters:
builder (
Gtk.Builder
) – aGtkBuilder
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
Similar to gtk_buildable_parser_finished() but is called once for each custom tag handled by the buildable.
- do_custom_tag_end(builder, child, tagname, data) virtual¶
- Parameters:
builder (
Gtk.Builder
) –GtkBuilder
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
Called at the end of each custom element handled by the buildable.
- do_custom_tag_start(builder, child, tagname) virtual¶
- Parameters:
builder (
Gtk.Builder
) – aGtkBuilder
used to construct this objectchild (
GObject.Object
orNone
) – child object orNone
for non-child tagstagname (
str
) – name of tag
- Returns:
True
if an object has a custom implementation,False
if it doesn’t.- parser:
a
GtkBuildableParser
to fill in- data:
return location for user data that will be passed in to parser functions
- Return type:
(
bool
, parser:Gtk.BuildableParser
, data:object
)
Called for each unknown element under
<child>
.
- do_get_id() virtual¶
- Return type:
The getter corresponding to set_id. Implement this if you implement set_id.
- do_get_internal_child(builder, childname) virtual¶
- Parameters:
builder (
Gtk.Builder
) – aGtkBuilder
childname (
str
) – name of child
- Returns:
the internal child of the buildable object
- Return type:
Retrieves the internal child called childname of the buildable object.
- do_parser_finished(builder) virtual¶
- Parameters:
builder (
Gtk.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 theGtkWidget:visible
property here.
- do_set_buildable_property(builder, name, value) virtual¶
- Parameters:
builder (
Gtk.Builder
) –name (
str
) –value (
GObject.Value
) –
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.