CtkListBox

CtkListBox — A list container

Functions

gboolean (*CtkListBoxFilterFunc) ()
gint (*CtkListBoxSortFunc) ()
void (*CtkListBoxUpdateHeaderFunc) ()
CtkWidget * ctk_list_box_new ()
void ctk_list_box_prepend ()
void ctk_list_box_insert ()
void ctk_list_box_select_row ()
void ctk_list_box_unselect_row ()
void ctk_list_box_select_all ()
void ctk_list_box_unselect_all ()
CtkListBoxRow * ctk_list_box_get_selected_row ()
void (*CtkListBoxForeachFunc) ()
void ctk_list_box_selected_foreach ()
GList * ctk_list_box_get_selected_rows ()
void ctk_list_box_set_selection_mode ()
CtkSelectionMode ctk_list_box_get_selection_mode ()
void ctk_list_box_set_activate_on_single_click ()
gboolean ctk_list_box_get_activate_on_single_click ()
CtkAdjustment * ctk_list_box_get_adjustment ()
void ctk_list_box_set_adjustment ()
void ctk_list_box_set_placeholder ()
CtkListBoxRow * ctk_list_box_get_row_at_index ()
CtkListBoxRow * ctk_list_box_get_row_at_y ()
void ctk_list_box_invalidate_filter ()
void ctk_list_box_invalidate_headers ()
void ctk_list_box_invalidate_sort ()
void ctk_list_box_set_filter_func ()
void ctk_list_box_set_header_func ()
void ctk_list_box_set_sort_func ()
void ctk_list_box_drag_highlight_row ()
void ctk_list_box_drag_unhighlight_row ()
CtkWidget * (*CtkListBoxCreateWidgetFunc) ()
void ctk_list_box_bind_model ()
CtkWidget * ctk_list_box_row_new ()
void ctk_list_box_row_changed ()
gboolean ctk_list_box_row_is_selected ()
CtkWidget * ctk_list_box_row_get_header ()
void ctk_list_box_row_set_header ()
gint ctk_list_box_row_get_index ()
void ctk_list_box_row_set_activatable ()
gboolean ctk_list_box_row_get_activatable ()
void ctk_list_box_row_set_selectable ()
gboolean ctk_list_box_row_get_selectable ()

Properties

gboolean activate-on-single-click Read / Write
CtkSelectionMode selection-mode Read / Write
gboolean activatable Read / Write
gboolean selectable Read / Write

Signals

void activate-cursor-row Action
void move-cursor Action
void row-activated Run Last
void row-selected Run Last
void select-all Action
void selected-rows-changed Run First
void toggle-cursor-row Action
void unselect-all Action
void activate Action

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── CtkWidget
            ╰── CtkContainer
                ├── CtkBin
                   ╰── CtkListBoxRow
                ╰── CtkListBox

Implemented Interfaces

CtkListBox implements AtkImplementorIface and CtkBuildable.

CtkListBoxRow implements AtkImplementorIface, CtkBuildable and CtkActionable.

Includes

#include <ctk/ctk.h>

Description

A CtkListBox is a vertical container that contains CtkListBoxRow children. These rows can by dynamically sorted and filtered, and headers can be added dynamically depending on the row content. It also allows keyboard and mouse navigation and selection like a typical list.

Using CtkListBox is often an alternative to CtkTreeView, especially when the list contents has a more complicated layout than what is allowed by a CtkCellRenderer, or when the contents is interactive (i.e. has a button in it).

Although a CtkListBox must have only CtkListBoxRow children you can add any kind of widget to it via ctk_container_add(), and a CtkListBoxRow widget will automatically be inserted between the list and the widget.

CtkListBoxRows can be marked as activatable or selectable. If a row is activatable, “row-activated” will be emitted for it when the user tries to activate it. If it is selectable, the row will be marked as selected when the user tries to select it.

The CtkListBox widget was added in CTK+ 3.10.

CtkListBox as CtkBuildable

The CtkListBox implementation of the CtkBuildable interface supports setting a child as the placeholder by specifying “placeholder” as the “type” attribute of a <child> element. See ctk_list_box_set_placeholder() for info.


CSS nodes

1
2
list
╰── row[.activatable]

CtkListBox uses a single CSS node named list. Each CtkListBoxRow uses a single CSS node named row. The row nodes get the .activatable style class added when appropriate.

Functions

CtkListBoxFilterFunc ()

gboolean
(*CtkListBoxFilterFunc) (CtkListBoxRow *row,
                         gpointer user_data);

Will be called whenever the row changes or is added and lets you control if the row should be visible or not.

Parameters

row

the row that may be filtered

 

user_data

user data.

[closure]

Returns

TRUE if the row should be visible, FALSE otherwise

Since: 3.10


CtkListBoxSortFunc ()

gint
(*CtkListBoxSortFunc) (CtkListBoxRow *row1,
                       CtkListBoxRow *row2,
                       gpointer user_data);

Compare two rows to determine which should be first.

Parameters

row1

the first row

 

row2

the second row

 

user_data

user data.

[closure]

Returns

< 0 if row1 should be before row2 , 0 if they are equal and > 0 otherwise

Since: 3.10


CtkListBoxUpdateHeaderFunc ()

void
(*CtkListBoxUpdateHeaderFunc) (CtkListBoxRow *row,
                               CtkListBoxRow *before,
                               gpointer user_data);

Whenever row changes or which row is before row changes this is called, which lets you update the header on row . You may remove or set a new one via ctk_list_box_row_set_header() or just change the state of the current header widget.

Parameters

row

the row to update

 

before

the row before row , or NULL if it is first.

[allow-none]

user_data

user data.

[closure]

Since: 3.10


ctk_list_box_new ()

CtkWidget *
ctk_list_box_new (void);

Creates a new CtkListBox container.

Returns

a new CtkListBox

Since: 3.10


ctk_list_box_prepend ()

void
ctk_list_box_prepend (CtkListBox *box,
                      CtkWidget *child);

Prepend a widget to the list. If a sort function is set, the widget will actually be inserted at the calculated position and this function has the same effect of ctk_container_add().

Parameters

box

a CtkListBox

 

child

the CtkWidget to add

 

Since: 3.10


ctk_list_box_insert ()

void
ctk_list_box_insert (CtkListBox *box,
                     CtkWidget *child,
                     gint position);

Insert the child into the box at position . If a sort function is set, the widget will actually be inserted at the calculated position and this function has the same effect of ctk_container_add().

If position is -1, or larger than the total number of items in the box , then the child will be appended to the end.

Parameters

box

a CtkListBox

 

child

the CtkWidget to add

 

position

the position to insert child in

 

Since: 3.10


ctk_list_box_select_row ()

void
ctk_list_box_select_row (CtkListBox *box,
                         CtkListBoxRow *row);

Make row the currently selected row.

Parameters

box

a CtkListBox

 

row

The row to select or NULL.

[allow-none]

Since: 3.10


ctk_list_box_unselect_row ()

void
ctk_list_box_unselect_row (CtkListBox *box,
                           CtkListBoxRow *row);

Unselects a single row of box , if the selection mode allows it.

Parameters

box

a CtkListBox

 

row

the row to unselected

 

Since: 3.14


ctk_list_box_select_all ()

void
ctk_list_box_select_all (CtkListBox *box);

Select all children of box , if the selection mode allows it.

Parameters

box

a CtkListBox

 

Since: 3.14


ctk_list_box_unselect_all ()

void
ctk_list_box_unselect_all (CtkListBox *box);

Unselect all children of box , if the selection mode allows it.

Parameters

box

a CtkListBox

 

Since: 3.14


ctk_list_box_get_selected_row ()

CtkListBoxRow *
ctk_list_box_get_selected_row (CtkListBox *box);

Gets the selected row.

Note that the box may allow multiple selection, in which case you should use ctk_list_box_selected_foreach() to find all selected rows.

Parameters

box

a CtkListBox

 

Returns

the selected row.

[transfer none]

Since: 3.10


CtkListBoxForeachFunc ()

void
(*CtkListBoxForeachFunc) (CtkListBox *box,
                          CtkListBoxRow *row,
                          gpointer user_data);

A function used by ctk_list_box_selected_foreach(). It will be called on every selected child of the box .

Parameters

box

a CtkListBox

 

row

a CtkListBoxRow

 

user_data

user data.

[closure]

Since: 3.14


ctk_list_box_selected_foreach ()

void
ctk_list_box_selected_foreach (CtkListBox *box,
                               CtkListBoxForeachFunc func,
                               gpointer data);

Calls a function for each selected child.

Note that the selection cannot be modified from within this function.

Parameters

box

a CtkListBox

 

func

the function to call for each selected child.

[scope call]

data

user data to pass to the function

 

Since: 3.14


ctk_list_box_get_selected_rows ()

GList *
ctk_list_box_get_selected_rows (CtkListBox *box);

Creates a list of all selected children.

Parameters

box

a CtkListBox

 

Returns

A GList containing the CtkWidget for each selected child. Free with g_list_free() when done.

[element-type CtkListBoxRow][transfer container]

Since: 3.14


ctk_list_box_set_selection_mode ()

void
ctk_list_box_set_selection_mode (CtkListBox *box,
                                 CtkSelectionMode mode);

Sets how selection works in the listbox. See CtkSelectionMode for details.

Parameters

box

a CtkListBox

 

mode

The CtkSelectionMode

 

Since: 3.10


ctk_list_box_get_selection_mode ()

CtkSelectionMode
ctk_list_box_get_selection_mode (CtkListBox *box);

Gets the selection mode of the listbox.

Parameters

box

a CtkListBox

 

Returns

a CtkSelectionMode

Since: 3.10


ctk_list_box_set_activate_on_single_click ()

void
ctk_list_box_set_activate_on_single_click
                               (CtkListBox *box,
                                gboolean single);

If single is TRUE, rows will be activated when you click on them, otherwise you need to double-click.

Parameters

box

a CtkListBox

 

single

a boolean

 

Since: 3.10


ctk_list_box_get_activate_on_single_click ()

gboolean
ctk_list_box_get_activate_on_single_click
                               (CtkListBox *box);

Returns whether rows activate on single clicks.

Parameters

box

a CtkListBox

 

Returns

TRUE if rows are activated on single click, FALSE otherwise

Since: 3.10


ctk_list_box_get_adjustment ()

CtkAdjustment *
ctk_list_box_get_adjustment (CtkListBox *box);

Gets the adjustment (if any) that the widget uses to for vertical scrolling.

Parameters

box

a CtkListBox

 

Returns

the adjustment.

[transfer none]

Since: 3.10


ctk_list_box_set_adjustment ()

void
ctk_list_box_set_adjustment (CtkListBox *box,
                             CtkAdjustment *adjustment);

Sets the adjustment (if any) that the widget uses to for vertical scrolling. For instance, this is used to get the page size for PageUp/Down key handling.

In the normal case when the box is packed inside a CtkScrolledWindow the adjustment from that will be picked up automatically, so there is no need to manually do that.

Parameters

box

a CtkListBox

 

adjustment

the adjustment, or NULL.

[allow-none]

Since: 3.10


ctk_list_box_set_placeholder ()

void
ctk_list_box_set_placeholder (CtkListBox *box,
                              CtkWidget *placeholder);

Sets the placeholder widget that is shown in the list when it doesn't display any visible children.

Parameters

box

a CtkListBox

 

placeholder

a CtkWidget or NULL.

[allow-none]

Since: 3.10


ctk_list_box_get_row_at_index ()

CtkListBoxRow *
ctk_list_box_get_row_at_index (CtkListBox *box,
                               gint index_);

Gets the n-th child in the list (not counting headers). If _index is negative or larger than the number of items in the list, NULL is returned.

Parameters

box

a CtkListBox

 

index_

the index of the row

 

Returns

the child CtkWidget or NULL.

[transfer none][nullable]

Since: 3.10


ctk_list_box_get_row_at_y ()

CtkListBoxRow *
ctk_list_box_get_row_at_y (CtkListBox *box,
                           gint y);

Gets the row at the y position.

Parameters

box

a CtkListBox

 

y

position

 

Returns

the row or NULL in case no row exists for the given y coordinate.

[transfer none][nullable]

Since: 3.10


ctk_list_box_invalidate_filter ()

void
ctk_list_box_invalidate_filter (CtkListBox *box);

Update the filtering for all rows. Call this when result of the filter function on the box is changed due to an external factor. For instance, this would be used if the filter function just looked for a specific search string and the entry with the search string has changed.

Parameters

box

a CtkListBox

 

Since: 3.10


ctk_list_box_invalidate_headers ()

void
ctk_list_box_invalidate_headers (CtkListBox *box);

Update the separators for all rows. Call this when result of the header function on the box is changed due to an external factor.

Parameters

box

a CtkListBox

 

Since: 3.10


ctk_list_box_invalidate_sort ()

void
ctk_list_box_invalidate_sort (CtkListBox *box);

Update the sorting for all rows. Call this when result of the sort function on the box is changed due to an external factor.

Parameters

box

a CtkListBox

 

Since: 3.10


ctk_list_box_set_filter_func ()

void
ctk_list_box_set_filter_func (CtkListBox *box,
                              CtkListBoxFilterFunc filter_func,
                              gpointer user_data,
                              GDestroyNotify destroy);

By setting a filter function on the box one can decide dynamically which of the rows to show. For instance, to implement a search function on a list that filters the original list to only show the matching rows.

The filter_func will be called for each row after the call, and it will continue to be called each time a row changes (via ctk_list_box_row_changed()) or when ctk_list_box_invalidate_filter() is called.

Note that using a filter function is incompatible with using a model (see ctk_list_box_bind_model()).

Parameters

box

a CtkListBox

 

filter_func

callback that lets you filter which rows to show.

[closure user_data][allow-none]

user_data

user data passed to filter_func

 

destroy

destroy notifier for user_data

 

Since: 3.10


ctk_list_box_set_header_func ()

void
ctk_list_box_set_header_func (CtkListBox *box,
                              CtkListBoxUpdateHeaderFunc update_header,
                              gpointer user_data,
                              GDestroyNotify destroy);

By setting a header function on the box one can dynamically add headers in front of rows, depending on the contents of the row and its position in the list. For instance, one could use it to add headers in front of the first item of a new kind, in a list sorted by the kind.

The update_header can look at the current header widget using ctk_list_box_row_get_header() and either update the state of the widget as needed, or set a new one using ctk_list_box_row_set_header(). If no header is needed, set the header to NULL.

Note that you may get many calls update_header to this for a particular row when e.g. changing things that don’t affect the header. In this case it is important for performance to not blindly replace an existing header with an identical one.

The update_header function will be called for each row after the call, and it will continue to be called each time a row changes (via ctk_list_box_row_changed()) and when the row before changes (either by ctk_list_box_row_changed() on the previous row, or when the previous row becomes a different row). It is also called for all rows when ctk_list_box_invalidate_headers() is called.

Parameters

box

a CtkListBox

 

update_header

callback that lets you add row headers.

[closure user_data][allow-none]

user_data

user data passed to update_header

 

destroy

destroy notifier for user_data

 

Since: 3.10


ctk_list_box_set_sort_func ()

void
ctk_list_box_set_sort_func (CtkListBox *box,
                            CtkListBoxSortFunc sort_func,
                            gpointer user_data,
                            GDestroyNotify destroy);

By setting a sort function on the box one can dynamically reorder the rows of the list, based on the contents of the rows.

The sort_func will be called for each row after the call, and will continue to be called each time a row changes (via ctk_list_box_row_changed()) and when ctk_list_box_invalidate_sort() is called.

Note that using a sort function is incompatible with using a model (see ctk_list_box_bind_model()).

Parameters

box

a CtkListBox

 

sort_func

the sort function.

[closure user_data][allow-none]

user_data

user data passed to sort_func

 

destroy

destroy notifier for user_data

 

Since: 3.10


ctk_list_box_drag_highlight_row ()

void
ctk_list_box_drag_highlight_row (CtkListBox *box,
                                 CtkListBoxRow *row);

This is a helper function for implementing DnD onto a CtkListBox. The passed in row will be highlighted via ctk_drag_highlight(), and any previously highlighted row will be unhighlighted.

The row will also be unhighlighted when the widget gets a drag leave event.

Parameters

box

a CtkListBox

 

row

a CtkListBoxRow

 

Since: 3.10


ctk_list_box_drag_unhighlight_row ()

void
ctk_list_box_drag_unhighlight_row (CtkListBox *box);

If a row has previously been highlighted via ctk_list_box_drag_highlight_row() it will have the highlight removed.

Parameters

box

a CtkListBox

 

Since: 3.10


CtkListBoxCreateWidgetFunc ()

CtkWidget *
(*CtkListBoxCreateWidgetFunc) (gpointer item,
                               gpointer user_data);

Called for list boxes that are bound to a GListModel with ctk_list_box_bind_model() for each item that gets added to the model.

Versions of CTK+ prior to 3.18 called ctk_widget_show_all() on the rows created by the CtkListBoxCreateWidgetFunc, but this forced all widgets inside the row to be shown, and is no longer the case. Applications should be updated to show the desired row widgets.

Parameters

item

the item from the model for which to create a widget for.

[type GObject]

user_data

user data.

[closure]

Returns

a CtkWidget that represents item .

[transfer full]

Since: 3.16


ctk_list_box_bind_model ()

void
ctk_list_box_bind_model (CtkListBox *box,
                         GListModel *model,
                         CtkListBoxCreateWidgetFunc create_widget_func,
                         gpointer user_data,
                         GDestroyNotify user_data_free_func);

Binds model to box .

If box was already bound to a model, that previous binding is destroyed.

The contents of box are cleared and then filled with widgets that represent items from model . box is updated whenever model changes. If model is NULL, box is left empty.

It is undefined to add or remove widgets directly (for example, with ctk_list_box_insert() or ctk_container_add()) while box is bound to a model.

Note that using a model is incompatible with the filtering and sorting functionality in CtkListBox. When using a model, filtering and sorting should be implemented by the model.

Parameters

box

a CtkListBox

 

model

the GListModel to be bound to box .

[nullable]

create_widget_func

a function that creates widgets for items or NULL in case you also passed NULL as model .

[nullable]

user_data

user data passed to create_widget_func

 

user_data_free_func

function for freeing user_data

 

Since: 3.16


ctk_list_box_row_new ()

CtkWidget *
ctk_list_box_row_new (void);

Creates a new CtkListBoxRow, to be used as a child of a CtkListBox.

Returns

a new CtkListBoxRow

Since: 3.10


ctk_list_box_row_changed ()

void
ctk_list_box_row_changed (CtkListBoxRow *row);

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 ctk_list_box_row_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 ctk_list_box_invalidate_sort() on any model change, but that is more expensive.

Parameters

row

a CtkListBoxRow

 

Since: 3.10


ctk_list_box_row_is_selected ()

gboolean
ctk_list_box_row_is_selected (CtkListBoxRow *row);

Returns whether the child is currently selected in its CtkListBox container.

Parameters

row

a CtkListBoxRow

 

Returns

TRUE if row is selected

Since: 3.14


ctk_list_box_row_get_header ()

CtkWidget *
ctk_list_box_row_get_header (CtkListBoxRow *row);

Returns the current header of the row . This can be used in a CtkListBoxUpdateHeaderFunc to see if there is a header set already, and if so to update the state of it.

Parameters

row

a CtkListBoxRow

 

Returns

the current header, or NULL if none.

[transfer none][nullable]

Since: 3.10


ctk_list_box_row_set_header ()

void
ctk_list_box_row_set_header (CtkListBoxRow *row,
                             CtkWidget *header);

Sets the current header of the row . This is only allowed to be called from a CtkListBoxUpdateHeaderFunc. It will replace any existing header in the row, and be shown in front of the row in the listbox.

Parameters

row

a CtkListBoxRow

 

header

the header, or NULL.

[allow-none]

Since: 3.10


ctk_list_box_row_get_index ()

gint
ctk_list_box_row_get_index (CtkListBoxRow *row);

Gets the current index of the row in its CtkListBox container.

Parameters

row

a CtkListBoxRow

 

Returns

the index of the row , or -1 if the row is not in a listbox

Since: 3.10


ctk_list_box_row_set_activatable ()

void
ctk_list_box_row_set_activatable (CtkListBoxRow *row,
                                  gboolean activatable);

Set the “activatable” property for this row.

Parameters

row

a CtkListBoxRow

 

activatable

TRUE to mark the row as activatable

 

Since: 3.14


ctk_list_box_row_get_activatable ()

gboolean
ctk_list_box_row_get_activatable (CtkListBoxRow *row);

Gets the value of the “activatable” property for this row.

Parameters

row

a CtkListBoxRow

 

Returns

TRUE if the row is activatable

Since: 3.14


ctk_list_box_row_set_selectable ()

void
ctk_list_box_row_set_selectable (CtkListBoxRow *row,
                                 gboolean selectable);

Set the “selectable” property for this row.

Parameters

row

a CtkListBoxRow

 

selectable

TRUE to mark the row as selectable

 

Since: 3.14


ctk_list_box_row_get_selectable ()

gboolean
ctk_list_box_row_get_selectable (CtkListBoxRow *row);

Gets the value of the “selectable” property for this row.

Parameters

row

a CtkListBoxRow

 

Returns

TRUE if the row is selectable

Since: 3.14

Types and Values

struct CtkListBox

struct CtkListBox;

struct CtkListBoxClass

struct CtkListBoxClass {
  CtkContainerClass parent_class;

  void (*row_selected)        (CtkListBox      *box,
                               CtkListBoxRow   *row);
  void (*row_activated)       (CtkListBox      *box,
                               CtkListBoxRow   *row);
  void (*activate_cursor_row) (CtkListBox      *box);
  void (*toggle_cursor_row)   (CtkListBox      *box);
  void (*move_cursor)         (CtkListBox      *box,
                               CtkMovementStep  step,
                               gint             count);
  void (*selected_rows_changed) (CtkListBox    *box);
  void (*select_all)            (CtkListBox    *box);
  void (*unselect_all)          (CtkListBox    *box);
};

Members

row_selected ()

Class handler for the “row-selected” signal

 

row_activated ()

Class handler for the “row-activated” signal

 

activate_cursor_row ()

Class handler for the “activate-cursor-row” signal

 

toggle_cursor_row ()

Class handler for the “toggle-cursor-row” signal

 

move_cursor ()

Class handler for the “move-cursor” signal

 

selected_rows_changed ()

Class handler for the “selected-rows-changed” signal

 

select_all ()

Class handler for the “select-all” signal

 

unselect_all ()

Class handler for the “unselect-all” signal

 

struct CtkListBoxRow

struct CtkListBoxRow;

struct CtkListBoxRowClass

struct CtkListBoxRowClass {
  CtkBinClass parent_class;

  void (* activate) (CtkListBoxRow *row);
};

Members

activate ()

   

Property Details

The “activate-on-single-click” property

  “activate-on-single-click” gboolean

Activate row on a single click.

Owner: CtkListBox

Flags: Read / Write

Default value: TRUE


The “selection-mode” property

  “selection-mode”           CtkSelectionMode

The selection mode.

Owner: CtkListBox

Flags: Read / Write

Default value: CTK_SELECTION_SINGLE


The “activatable” property

  “activatable”              gboolean

The property determines whether the “row-activated” signal will be emitted for this row.

Owner: CtkListBoxRow

Flags: Read / Write

Default value: TRUE

Since: 3.14


The “selectable” property

  “selectable”               gboolean

The property determines whether this row can be selected.

Owner: CtkListBoxRow

Flags: Read / Write

Default value: TRUE

Since: 3.14

Signal Details

The “activate-cursor-row” signal

void
user_function (CtkListBox *ctklistbox,
               gpointer    user_data)

Flags: Action


The “move-cursor” signal

void
user_function (CtkListBox     *ctklistbox,
               CtkMovementStep arg1,
               int             arg2,
               gpointer        user_data)

Flags: Action


The “row-activated” signal

void
user_function (CtkListBox    *box,
               CtkListBoxRow *row,
               gpointer       user_data)

The ::row-activated signal is emitted when a row has been activated by the user.

Parameters

box

the CtkListBox

 

row

the activated row

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.10


The “row-selected” signal

void
user_function (CtkListBox    *box,
               CtkListBoxRow *row,
               gpointer       user_data)

The ::row-selected signal is emitted when a new row is selected, or (with a NULL row ) when the selection is cleared.

When the box is using CTK_SELECTION_MULTIPLE, this signal will not give you the full picture of selection changes, and you should use the “selected-rows-changed” signal instead.

Parameters

box

the CtkListBox

 

row

the selected row.

[nullable]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.10


The “select-all” signal

void
user_function (CtkListBox *box,
               gpointer    user_data)

The ::select-all signal is a keybinding signal which gets emitted to select all children of the box, if the selection mode permits it.

The default bindings for this signal is Ctrl-a.

Parameters

box

the CtkListBox on which the signal is emitted

 

user_data

user data set when the signal handler was connected.

 

Flags: Action

Since: 3.14


The “selected-rows-changed” signal

void
user_function (CtkListBox *box,
               gpointer    user_data)

The ::selected-rows-changed signal is emitted when the set of selected rows changes.

Parameters

box

the CtkListBox on wich the signal is emitted

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First

Since: 3.14


The “toggle-cursor-row” signal

void
user_function (CtkListBox *ctklistbox,
               gpointer    user_data)

Flags: Action


The “unselect-all” signal

void
user_function (CtkListBox *box,
               gpointer    user_data)

The ::unselect-all signal is a keybinding signal which gets emitted to unselect all children of the box, if the selection mode permits it.

The default bindings for this signal is Ctrl-Shift-a.

Parameters

box

the CtkListBox on which the signal is emitted

 

user_data

user data set when the signal handler was connected.

 

Flags: Action

Since: 3.14


The “activate” signal

void
user_function (CtkListBoxRow *ctklistboxrow,
               gpointer       user_data)

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” signal on the row’s parent CtkListBox.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Action

Since: 3.10

See Also

CtkScrolledWindow