Trait gtk4::prelude::ListItemExt

source ·
pub trait ListItemExt: IsA<ListItem> + Sealed + 'static {
Show 24 methods // Provided methods fn accessible_description(&self) -> GString { ... } fn accessible_label(&self) -> GString { ... } fn is_activatable(&self) -> bool { ... } fn child(&self) -> Option<Widget> { ... } fn is_focusable(&self) -> bool { ... } fn item(&self) -> Option<Object> { ... } fn position(&self) -> u32 { ... } fn is_selectable(&self) -> bool { ... } fn is_selected(&self) -> bool { ... } fn set_accessible_description(&self, description: &str) { ... } fn set_accessible_label(&self, label: &str) { ... } fn set_activatable(&self, activatable: bool) { ... } fn set_child(&self, child: Option<&impl IsA<Widget>>) { ... } fn set_focusable(&self, focusable: bool) { ... } fn set_selectable(&self, selectable: bool) { ... } fn connect_accessible_description_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_accessible_label_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_activatable_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_child_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_focusable_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_item_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_position_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_selectable_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_selected_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all ListItem methods.

§Implementors

ColumnViewCell, ListItem

Provided Methods§

source

fn accessible_description(&self) -> GString

Available on crate feature v4_12 only.

Gets the accessible description of @self.

§Returns

the accessible description

source

fn accessible_label(&self) -> GString

Available on crate feature v4_12 only.

Gets the accessible label of @self.

§Returns

the accessible label

source

fn is_activatable(&self) -> bool

Checks if a list item has been set to be activatable via gtk_list_item_set_activatable().

§Returns

true if the item is activatable

source

fn child(&self) -> Option<Widget>

Gets the child previously set via gtk_list_item_set_child() or None if none was set.

§Returns

The child

source

fn is_focusable(&self) -> bool

Available on crate feature v4_12 only.

Checks if a list item has been set to be focusable via gtk_list_item_set_focusable().

§Returns

true if the item is focusable

source

fn item(&self) -> Option<Object>

Gets the model item that associated with @self.

If @self is unbound, this function returns None.

§Returns

The item displayed

source

fn position(&self) -> u32

Gets the position in the model that @self currently displays.

If @self is unbound, GTK_INVALID_LIST_POSITION is returned.

§Returns

The position of this item

source

fn is_selectable(&self) -> bool

Checks if a list item has been set to be selectable via gtk_list_item_set_selectable().

Do not confuse this function with is_selected().

§Returns

true if the item is selectable

source

fn is_selected(&self) -> bool

Checks if the item is displayed as selected.

The selected state is maintained by the liste widget and its model and cannot be set otherwise.

§Returns

true if the item is selected.

source

fn set_accessible_description(&self, description: &str)

Available on crate feature v4_12 only.

Sets the accessible description for the list item, which may be used by e.g. screen readers.

§description

the description

source

fn set_accessible_label(&self, label: &str)

Available on crate feature v4_12 only.

Sets the accessible label for the list item, which may be used by e.g. screen readers.

§label

the label

source

fn set_activatable(&self, activatable: bool)

Sets @self to be activatable.

If an item is activatable, double-clicking on the item, using the Return key or calling gtk_widget_activate() will activate the item. Activating instructs the containing view to handle activation. ListView for example will be emitting the activate signal.

By default, list items are activatable.

§activatable

if the item should be activatable

source

fn set_child(&self, child: Option<&impl IsA<Widget>>)

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

The list item’s child or None to unset

source

fn set_focusable(&self, focusable: bool)

Available on crate feature v4_12 only.

Sets @self to be focusable.

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

§focusable

if the item should be focusable

source

fn set_selectable(&self, selectable: bool)

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, list items are selectable. When rebinding them to a new item, they will also be reset to be selectable by GTK.

§selectable

if the item should be selectable

source

fn connect_accessible_description_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Available on crate feature v4_12 only.
source

fn connect_accessible_label_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Available on crate feature v4_12 only.
source

fn connect_activatable_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_focusable_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Available on crate feature v4_12 only.
source

fn connect_item_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_position_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_selectable_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_selected_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§