About all my projects
Gnome::Gtk4::ListBoxRow

Gnome::Gtk4::ListBoxRow

Description

Gnome::Gtk4::ListBoxRow is the kind of widget that can be added to a Gnome::Gtk4::ListBox.

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-listboxrow

Creates a new Gnome::Gtk4::ListBoxRow.

method new-listboxrow ( --> Gnome::Gtk4::ListBoxRow \)

Methods

changed

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

This affects sorting, filtering and headers.

Note that calls to this method must be in sync with the data used for the row functions. For instance, if the list is mirroring some external data set, and *two* rows changed in the external data set then when you call .changed() on the first row the sort function must only read the new data for the first of the two changed rows, otherwise the resorting of the rows 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 listbox row functions into the row widgets themselves. Another alternative is to call .invalidate-sort() in class Gnome::Gtk4::ListBox on any model change, but that is more expensive.

method changed ( )

get-activatable

Gets whether the row is activatable.

method get-activatable (--> Bool )

Return value; True if the row is activatable.

get-child

Gets the child widget of $row.

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

Return value; the child widget of $row.

get-header

Returns the current header of the $row.

This can be used in a [callback $Gtk.ListBoxUpdateHeaderFunc] to see if there is a header set already, and if so to update the state of it.

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

Return value; the current header.

get-index

Gets the current index of the $row in its Gnome::Gtk4::ListBox container.

method get-index (--> Int )

Return value; the index of the $row, or -1 if the $row is not in a listbox.

get-selectable

Gets whether the row can be selected.

method get-selectable (--> Bool )

Return value; True if the row is selectable.

is-selected

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

method is-selected (--> Bool )

Return value; True if $row is selected.

set-activatable

Set whether the row is activatable.

method set-activatable ( Bool() $activatable )
  • $activatable; True to mark the row as activatable.

set-child

Sets the child widget of $self.

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

set-header

Sets the current header of the $row.

This is only allowed to be called from a [callback $Gtk.ListBoxUpdateHeaderFunc]. It will replace any existing header in the row, and be shown in front of the row in the listbox.

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

set-selectable

Set whether the row can be selected.

method set-selectable ( Bool() $selectable )
  • $selectable; True to mark the row as selectable.

Signals

activate

This is a keybinding signal, which will cause this row to be activated.

If you want to be notified when the user activates a row (by key or not), use the row-activated defined in ListBox signal on the row’s parent Gnome::Gtk4::ListBox.

method handler (
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::ListBoxRow :$_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::ListBoxRow 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.