Buildable#
- class Buildable(*args, **kwargs)#
Implementations: AboutDialog, ActionBar, AnyFilter, AppChooserButton, AppChooserDialog, AppChooserWidget, ApplicationWindow, AspectFrame, Assistant, Box, Button, Calendar, CellArea, CellAreaBox, CellView, CenterBox, CheckButton, ColorButton, ColorChooserDialog, ColorChooserWidget, ColorDialogButton, ColumnView, ComboBox, ComboBoxText, ConstraintLayout, Dialog, DragIcon, DrawingArea, DropDown, EditableLabel, EmojiChooser, Entry, EntryCompletion, EveryFilter, Expander, FileChooserDialog, FileChooserWidget, FileFilter, Fixed, FlowBox, FlowBoxChild, FontButton, FontChooserDialog, FontChooserWidget, FontDialogButton, Frame, GLArea, GraphicsOffload, Grid, GridView, HeaderBar, IconView, Image, InfoBar, Inscription, Label, LevelBar, LinkButton, ListBase, ListBox, ListBoxRow, ListStore, ListView, LockButton, MediaControls, MenuButton, MessageDialog, MultiFilter, MultiSorter, Notebook, Overlay, PageSetupUnixDialog, Paned, PasswordEntry, Picture, Popover, PopoverBin, PopoverMenu, PopoverMenuBar, PrintUnixDialog, ProgressBar, Range, Revealer, Scale, ScaleButton, Scrollbar, ScrolledWindow, SearchBar, SearchEntry, Separator, ShortcutController, ShortcutLabel, ShortcutsGroup, ShortcutsSection, ShortcutsShortcut, ShortcutsWindow, SizeGroup, SpinButton, Spinner, Stack, StackSidebar, StackSwitcher, Statusbar, StringList, Switch, Text, TextTagTable, TextView, ToggleButton, TreeExpander, TreeStore, TreeView, TreeViewColumn, Video, Viewport, VolumeButton, Widget, Window, WindowControls, WindowHandle
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 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.
Methods#
Virtual Methods#
- class Buildable
- do_add_child(builder: Builder, child: Object, type: str | None = None) None#
Adds a child to
buildable.typeis an optional string describing how the child should be added.- Parameters:
builder – a
GtkBuilderchild – child to add
type – kind of child or
None
- do_custom_finished(builder: Builder, child: Object | None, tagname: str, data: Any = None) None#
Similar to gtk_buildable_parser_finished() but is called once for each custom tag handled by the
buildable.- Parameters:
builder – a
GtkBuilderchild – child object or
Nonefor non-child tagstagname – the name of the tag
data – user data created in custom_tag_start
- do_custom_tag_end(builder: Builder, child: Object | None, tagname: str, data: Any = None) None#
Called at the end of each custom element handled by the buildable.
- Parameters:
builder –
GtkBuilderused to construct this objectchild – child object or
Nonefor non-child tagstagname – name of tag
data – user data that will be passed in to parser functions
- do_custom_tag_start(builder: Builder, child: Object | None, tagname: str) tuple[bool, BuildableParser, Any | None]#
Called for each unknown element under
<child>.- Parameters:
builder – a
GtkBuilderused to construct this objectchild – child object or
Nonefor non-child tagstagname – name of tag
- do_get_internal_child(builder: Builder, childname: str) Object#
Retrieves the internal child called
childnameof thebuildableobject.- Parameters:
builder – a
GtkBuilderchildname – name of child
- do_parser_finished(builder: Builder) None#
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.
GtkWindowsets theGtkWidget:visibleproperty here.- Parameters:
builder
- do_set_buildable_property(builder: Builder, name: str, value: Value) None#
Sets a property of a buildable object. It is normally not necessary to implement this,
set_property()is used by default.GtkWindowimplements this to delay showing itself (i.e. setting thevisibleproperty) until the whole interface is created.- Parameters:
builder
name
value