Used by list widgets to represent items in a [ifaceGio.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 [methodGtk.ListItem.set_child].
GtkListItem objects exist in 2 stages:
The unbound stage where the listitem is not currently connected to an
item in the list. In that case, the [propertyGtk.ListItem:item] property is set to NULL.
The bound stage where the listitem references an item from the list.
The [propertyGtk.ListItem:item] property is not NULL.
Accessible_Description_Property : constant Glib.Properties.Property_String;
The accessible description to set on the listitem.
Accessible_Label_Property : constant Glib.Properties.Property_String;
The accessible label to set on the listitem.
Activatable_Property : constant Glib.Properties.Property_Boolean;
If the item can be activated by the user.
Child_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Widget.Gtk_Widget Widget used for display.
Focusable_Property : constant Glib.Properties.Property_Boolean;
If the item can be focused with the keyboard.
function Get_Accessible_Description
(Self : not null access Gtk_List_Item_Record) return UTF8_String
Gets the accessible description of Self. Since: gtk+ 4.12
the accessible description
function Get_Accessible_Label
(Self : not null access Gtk_List_Item_Record) return UTF8_String
Gets the accessible label of Self. Since: gtk+ 4.12
the accessible label
function Get_Activatable
(Self : not null access Gtk_List_Item_Record) return Boolean
Checks if a listitem has been set to be activatable via [methodGtk.ListItem.set_activatable].
true if the item is activatable
function Get_Child
(Self : not null access Gtk_List_Item_Record)
return Gtk.Widget.Gtk_Widget
Gets the child previously set via [methodGtk.ListItem.set_child] or NULL if none was set.
The child. Has transfer-ownership='none'.
function Get_Focusable
(Self : not null access Gtk_List_Item_Record) return Boolean
Checks if a listitem has been set to be focusable via [methodGtk.ListItem.set_focusable]. Since: gtk+ 4.12
true if the item is focusable
function Get_Item
(Self : not null access Gtk_List_Item_Record)
return Glib.Object.GObject
Gets the model item that associated with Self. If Self is unbound, this function returns NULL.
The item displayed
function Get_Position
(Self : not null access Gtk_List_Item_Record) return Guint
Gets the position in the model that Self currently displays. If Self is unbound, GTK_INVALID_LIST_POSITION is returned.
The position of this item
function Get_Selectable
(Self : not null access Gtk_List_Item_Record) return Boolean
Checks if a listitem has been set to be selectable via [methodGtk.ListItem.set_selectable]. Do not confuse this function with [methodGtk.ListItem.get_selected].
true if the item is selectable
function Get_Selected
(Self : not null access Gtk_List_Item_Record) return Boolean
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.
true if the item is selected.
function Get_Type return Glib.GType
type Gtk_List_Item is access all Gtk_List_Item_Record'Class;
type Gtk_List_Item_Record is new GObject_Record with null record;
Item_Property : constant Glib.Properties.Property_Object;
Type: Glib.Object.GObject Displayed item.
Position_Property : constant Glib.Properties.Property_Uint;
Position of the item.
Selectable_Property : constant Glib.Properties.Property_Boolean;
If the item can be selected by the user.
Selected_Property : constant Glib.Properties.Property_Boolean;
If the item is currently selected.
procedure Set_Accessible_Description
(Self : not null access Gtk_List_Item_Record;
Description : UTF8_String)
Sets the accessible description for the listitem. The accessible description may be used by e.g. screen readers. Since: gtk+ 4.12
the description
procedure Set_Accessible_Label
(Self : not null access Gtk_List_Item_Record;
Label : UTF8_String)
Sets the accessible label for the listitem. The accessible label may be used by e.g. screen readers. Since: gtk+ 4.12
the label
procedure Set_Activatable
(Self : not null access Gtk_List_Item_Record;
Activatable : Boolean)
Sets Self to be activatable. If an item is activatable, double-clicking on the item, using the Return key or calling [methodGtk.Widget.activate] will activate the item. Activating instructs the containing view to handle activation. GtkListView for example will be emitting the [signalGtk.ListView::activate] signal. By default, listitems are activatable.
if the item should be activatable
procedure Set_Child
(Self : not null access Gtk_List_Item_Record;
Child : access Gtk.Widget.Gtk_Widget_Record'Class)
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.
The listitem's child or NULL to unset
procedure Set_Focusable
(Self : not null access Gtk_List_Item_Record;
Focusable : Boolean)
Sets Self to be focusable. If an item is focusable, it can be focused using the keyboard. This works similar to [methodGtk.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. Since: gtk+ 4.12
if the item should be focusable
procedure Set_Selectable
(Self : not null access Gtk_List_Item_Record;
Selectable : Boolean)
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.
if the item should be selectable