Basics
Guides
API Reference
Basics
Guides
API Reference
[384:14] static extends: object
Generated metadata helpers for ListItem class surfaces.
properties ()
Returns property metadata for
ListItem.
A list.[20:7] extends: object
Used by list widgets to represent items in a [iface@Gio.ListModel].
GtkListItem objects are managed by the list widget (with its factory) and
cannot be created by applications, but they need to be populated by
application code. This is done by calling [method@Gtk.ListItem.set_child].
GtkListItem objects exist in 2 stages: 1. The unbound stage where the
listitem is not currently connected to an item in the list. In that case, the
[property@Gtk.ListItem:item] property is set to NULL. 2. The bound stage
where the listitem references an item from the list. The
[property@Gtk.ListItem:item] property is not NULL.
ListItem (Handle = null)
Creates a new
ListItemby wrapping a native handle or another wrapper.
Handle is the native handle or another wrapper whose handle to adopt.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setAccessibledescription (string Value)
The accessible description to set on the listitem.
Value is the new property value.None.setAccessiblelabel (string Value)
The accessible label to set on the listitem.
Value is the new property value.None.setActivatable (bool Value)
If the item can be activated by the user.
Value is the new property value.None.setChild (object Value)
Widget used for display.
Value is the new property value.None.setFocusable (bool Value)
If the item can be focused with the keyboard.
Value is the new property value.None.setSelectable (bool Value)
If the item can be selected by the user.
Value is the new property value.None.get_accessible_description ()
Gets the accessible description of @self.
get_accessible_label ()
Gets the accessible label of @self.
get_activatable ()
Checks if a listitem has been set to be activatable via [method@Gtk.ListItem.set_activatable].
get_child ()
Gets the child previously set via [method@Gtk.ListItem.set_child] or
NULLif none was set.
get_focusable ()
Checks if a listitem has been set to be focusable via [method@Gtk.ListItem.set_focusable].
get_item ()
Gets the model item that associated with @self. If @self is unbound, this function returns
NULL.
get_position ()
Gets the position in the model that @self currently displays. If @self is unbound,
GTK_INVALID_LIST_POSITIONis returned.
get_selectable ()
Checks if a listitem has been set to be selectable via [method@Gtk.ListItem.set_selectable]. Do not confuse this function with [method@Gtk.ListItem.get_selected].
get_selected ()
Checks if the item is displayed as selected. The selected state is maintained by the list widget and its model and cannot be set otherwise.
set_accessible_description (string description)
Sets the accessible description for the listitem. The accessible description may be used by e.g. screen readers.
description is the description.None.set_accessible_label (string label)
Sets the accessible label for the listitem. The accessible label may be used by e.g. screen readers.
label is the label.None.set_activatable (bool activatable)
Sets @self to be activatable. If an item is activatable, double-clicking on the item, using the Return key or calling [method@Gtk.Widget.activate] will activate the item. Activating instructs the containing view to handle activation.
GtkListViewfor example will be emitting the [signal@Gtk.ListView::activate] signal. By default, listitems are activatable.
activatable is if the item should be activatable.None.set_child (object child)
Sets the child to be used for this listitem. This function is typically called by applications when setting up a listitem so that the widget can be reused when binding it multiple times.
child is The listitem's child or NULL to unset.None.set_focusable (bool focusable)
Sets @self to be focusable. If an item is focusable, it can be focused using the keyboard. This works similar to [method@Gtk.Widget.set_focusable]. Note that if items are not focusable, the keyboard cannot be used to activate them and selecting only works if one of the listitem's children is focusable. By default, listitems are focusable.
focusable is if the item should be focusable.None.set_selectable (bool selectable)
Sets @self to be selectable. If an item is selectable, clicking on the item or using the keyboard will try to select or unselect the item. If this succeeds is up to the model to determine, as it is managing the selected state. Note that this means that making an item non-selectable has no influence on the selected state at all. A non-selectable item may still be selected. By default, listitems are selectable. When rebinding them to a new item, they will also be reset to be selectable by GTK.
selectable is if the item should be selectable.None.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.