About all my projects
Gnome::Gtk4::FlowBoxChild

Gnome::Gtk4::FlowBoxChild

Description

Gnome::Gtk4::FlowBoxChild is the kind of widget that can be added to a Gnome::Gtk4::FlowBox.

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

new-flowboxchild

Creates a new Gnome::Gtk4::FlowBoxChild.

This should only be used as a child of a Gnome::Gtk4::FlowBox.

method new-flowboxchild ( --> Gnome::Gtk4::FlowBoxChild \)

Methods

changed

Marks $child 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 .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 .invalidate-sort() in class Gnome::Gtk4::FlowBox on any model change, but that is more expensive.

method changed ( )

get-child

Gets the child widget of $self.

method get-child (--> N-Object )

Return value; the child widget of $self.

get-index

Gets the current index of the $child in its Gnome::Gtk4::FlowBox container.

method get-index (--> Int )

Return value; the index of the $child, or -1 if the $child is not in a flow box.

is-selected

Returns whether the $child is currently selected in its Gnome::Gtk4::FlowBox container.

method is-selected (--> Bool )

Return value; True if $child is selected.

set-child

Sets the child widget of $self.

method set-child ( N-Object() $child )
  • $child; the child widget.

Signals

activate

Emitted when the user activates a child widget in a Gnome::Gtk4::FlowBox.

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

This is a [keybinding signal](class.SignalAction.html), but it can be used by applications for their own purposes.

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

method handler (
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::FlowBoxChild :$_widget,
  *C<user>-options
)
  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::FlowBoxChild object.

  • $_widget; The object which registered the signal. User code may have left the object going out of scope.

  • user-options; A list of named arguments provided at the .register-signal() method from Gnome::GObject::Object.