Gtk.ContainerClass

Fields

Name

Type

Access

Description

add

object

r

Signal emitted when a widget is added to container.

check_resize

object

r

Signal emitted when a size recalculation is needed.

child_type

object

r

Returns the type of the children supported by the container.

composite_name

object

r

Gets a widget’s composite name. Deprecated: 3.10.

forall

object

r

Invokes callback on each child of container. The callback handler may remove the child.

get_child_property

object

r

Get a property from a child of container.

get_path_for_child

object

r

Get path representing entire widget hierarchy from the toplevel down to and including child.

parent_class

Gtk.WidgetClass

r

The parent class.

remove

object

r

Signal emitted when a widget is removed from container.

set_child_property

object

r

Set a property on a child of container.

set_focus_child

object

r

Sets the focused child of container.

Methods

find_child_property (property_name)

handle_border_width ()

install_child_properties (pspecs)

install_child_property (property_id, pspec)

list_child_properties ()

Details

class Gtk.ContainerClass

Base class for containers.

find_child_property(property_name)[source]
Parameters:

property_name (str) – the name of the child property to find

Returns:

the GObject.ParamSpec of the child property or None if class has no child property with that name.

Return type:

GObject.ParamSpec or None

Finds a child property of a container class by name.

handle_border_width()[source]

Modifies a subclass of Gtk.ContainerClass to automatically add and remove the border-width setting on Gtk.Container. This allows the subclass to ignore the border width in its size request and allocate methods. The intent is for a subclass to invoke this in its class_init function.

Gtk.ContainerClass.handle_border_width() is necessary because it would break API too badly to make this behavior the default. So subclasses must “opt in” to the parent class handling border_width for them.

install_child_properties(pspecs)[source]
Parameters:

pspecs ([GObject.ParamSpec]) – the GObject.ParamSpec array defining the new child properties

Installs child properties on a container class.

New in version 3.18.

install_child_property(property_id, pspec)[source]
Parameters:

Installs a child property on a container class.

list_child_properties()[source]
Returns:

a newly allocated None-terminated array of GObject.ParamSpec. The array must be freed with GLib.free().

Return type:

[GObject.ParamSpec]

Returns all child properties of a container class.