1.114 <GtkListItem>

Class: <GtkListItem>

It derives from <GObject>.

Used by list widgets to represent items in a <GListModel>.

<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 list-item: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 list-item:item property is set to NULL.
  1. The bound stage where the listitem references an item from the list. The list-item:item property is not NULL.

Properties

Property: list-item:accessible-description self

The accessible description to set on the listitem.

Its value is a string, or #f.

Set it with (set! (list-item:accessible-description self) value).

Property: list-item:accessible-label self

The accessible label to set on the listitem.

Its value is a string, or #f.

Set it with (set! (list-item:accessible-label self) value).

Property: list-item:activatable self

If the item can be activated by the user.

Its value is a boolean.

Set it with (set! (list-item:activatable self) value).

Property: list-item:child self

Widget used for display.

Its value is a <GtkWidget>, or #f.

Set it with (set! (list-item:child self) value).

Property: list-item:focusable self

If the item can be focused with the keyboard.

Its value is a boolean.

Set it with (set! (list-item:focusable self) value).

Property: list-item:item self

Displayed item.

Its value is a <GObject>, or #f.

It is read only.

Property: list-item:position self

Position of the item.

Its value is an unsigned 32-bit integer.

It is read only.

Property: list-item:selectable self

If the item can be selected by the user.

Its value is a boolean.

Set it with (set! (list-item:selectable self) value).

Property: list-item:selected self

If the item is currently selected.

Its value is a boolean.

It is read only.

Procedures

Method: list-item:get-accessible-description self ⇒ %return
Method: get-accessible-description self ⇒ %return

Gets the accessible description of self.

self

Passed: a <GtkListItem>.

a listitem

%return

Returned: a string.

the accessible description

Method: list-item:get-accessible-label self ⇒ %return
Method: get-accessible-label self ⇒ %return

Gets the accessible label of self.

self

Passed: a <GtkListItem>.

a listitem

%return

Returned: a string.

the accessible label

Method: list-item:get-activatable? self ⇒ %return
Method: get-activatable? self ⇒ %return

Checks if a listitem has been set to be activatable via list-item:set-activatable.

self

Passed: a <GtkListItem>.

a listitem

%return

Returned: a boolean.

true if the item is activatable

Method: list-item:get-child self ⇒ %return
Method: get-child self ⇒ %return

Gets the child previously set via list-item:set-child or NULL if none was set.

self

Passed: a <GtkListItem>.

a listitem

%return

Returned: a <GtkWidget>, or #f.

The child

Method: list-item:get-focusable? self ⇒ %return
Method: get-focusable? self ⇒ %return

Checks if a listitem has been set to be focusable via list-item:set-focusable.

self

Passed: a <GtkListItem>.

a lits item

%return

Returned: a boolean.

true if the item is focusable

Method: list-item:get-item self ⇒ %return
Method: get-item self ⇒ %return

Gets the model item that associated with self.

If self is unbound, this function returns NULL.

self

Passed: a <GtkListItem>.

a listitem

%return

Returned: a <GObject>, or #f.

The item displayed

Method: list-item:get-position self ⇒ %return
Method: get-position self ⇒ %return

Gets the position in the model that self currently displays.

If self is unbound, GTK_INVALID_LIST_POSITION is returned.

self

Passed: a <GtkListItem>.

a listitem

%return

Returned: an unsigned 32-bit integer.

The position of this item

Method: list-item:get-selectable? self ⇒ %return
Method: get-selectable? self ⇒ %return

Checks if a listitem has been set to be selectable via list-item:set-selectable.

Do not confuse this function with list-item:get-selected?.

self

Passed: a <GtkListItem>.

a listitem

%return

Returned: a boolean.

true if the item is selectable

Method: list-item:get-selected? self ⇒ %return
Method: get-selected? self ⇒ %return

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.

self

Passed: a <GtkListItem>.

a listitem

%return

Returned: a boolean.

true if the item is selected.

Method: list-item:set-accessible-description self description
Method: set-accessible-description self description

Sets the accessible description for the listitem.

The accessible description may be used by e.g. screen readers.

self

Passed: a <GtkListItem>.

a listitem

description

Passed: a string.

the description

Method: list-item:set-accessible-label self label
Method: set-accessible-label self label

Sets the accessible label for the listitem.

The accessible label may be used by e.g. screen readers.

self

Passed: a <GtkListItem>.

a listitem

label

Passed: a string.

the label

Method: list-item:set-activatable self activatable
Method: set-activatable self activatable

Sets self to be activatable.

If an item is activatable, double-clicking on the item, using the Return key or calling widget:activate? will activate the item. Activating instructs the containing view to handle activation. <GtkListView> for example will be emitting the list-view:activate signal.

By default, listitems are activatable.

self

Passed: a <GtkListItem>.

a listitem

activatable

Passed: a boolean.

if the item should be activatable

Method: list-item:set-child self [child]
Method: set-child self [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.

self

Passed: a <GtkListItem>.

a listitem

child

Passed, or left out: a <GtkWidget>, or #f.

The listitem’s child or NULL to unset

Method: list-item:set-focusable self focusable
Method: set-focusable self focusable

Sets self to be focusable.

If an item is focusable, it can be focused using the keyboard. This works similar to 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.

self

Passed: a <GtkListItem>.

a listitem

focusable

Passed: a boolean.

if the item should be focusable

Method: list-item:set-selectable self selectable
Method: set-selectable self 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.

self

Passed: a <GtkListItem>.

a listitem

selectable

Passed: a boolean.

if the item should be selectable