Gtk.FlowBoxChild

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.FlowBoxChild Gtk.FlowBoxChild Gtk.Widget->Gtk.FlowBoxChild

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

changed ()

get_child ()

get_index ()

is_selected ()

set_child (child)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

do_activate ()

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

child

Gtk.Widget

r/w/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Short Description

activate

Emitted when the user activates a child widget in a GtkFlowBox.

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gtk.Widget

r

Class Details

class Gtk.FlowBoxChild(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

Gtk.FlowBoxChildClass

GtkFlowBoxChild is the kind of widget that can be added to a GtkFlowBox.

classmethod new()[source]
Returns:

a new GtkFlowBoxChild

Return type:

Gtk.Widget

Creates a new GtkFlowBoxChild.

This should only be used as a child of a GtkFlowBox.

changed()[source]

Marks self as changed, causing any state that depends on this to be updated.

This affects sorting and filtering.

Note that calls to this method must be in sync with the data used for the sorting and filtering functions. For instance, if the list is mirroring some external data set, and *two* children changed in the external data set when you call Gtk.FlowBoxChild.changed() on the first child, the sort function must only read the new data for the first of the two changed children, otherwise the resorting of the children will be wrong.

This generally means that if you don’t fully control the data model, you have to duplicate the data that affects the sorting and filtering functions into the widgets themselves.

Another alternative is to call [method`Gtk`.FlowBox.invalidate_sort] on any model change, but that is more expensive.

get_child()[source]
Returns:

the child widget of self

Return type:

Gtk.Widget or None

Gets the child widget of self.

get_index()[source]
Returns:

the index of the self, or -1 if the self is not in a flow box

Return type:

int

Gets the current index of the self in its GtkFlowBox container.

is_selected()[source]
Returns:

True if self is selected

Return type:

bool

Returns whether the self is currently selected in its GtkFlowBox container.

set_child(child)[source]
Parameters:

child (Gtk.Widget or None) – the child widget

Sets the child widget of self.

do_activate() virtual

Signal Details

Gtk.FlowBoxChild.signals.activate(flow_box_child)
Signal Name:

activate

Flags:

RUN_FIRST, ACTION

Parameters:

flow_box_child (Gtk.FlowBoxChild) – The object which received the signal

Emitted when the user activates a child widget in a GtkFlowBox.

This can happen either by clicking or double-clicking, or via a keybinding.

This is a keybinding signal, but it can be used by applications for their own purposes.

The default bindings are <kbd>Space</kbd> and <kbd>Enter</kbd>.

Property Details

Gtk.FlowBoxChild.props.child
Name:

child

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The child widget.