pub trait ListItemExt: IsA<ListItem> + '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
Provided Methods§
Sourcefn accessible_description(&self) -> GString
Available on crate feature v4_12
only.
fn accessible_description(&self) -> GString
v4_12
only.Sourcefn accessible_label(&self) -> GString
Available on crate feature v4_12
only.
fn accessible_label(&self) -> GString
v4_12
only.Sourcefn is_activatable(&self) -> bool
fn is_activatable(&self) -> bool
Checks if a listitem has been set to be activatable via
set_activatable()
.
§Returns
true if the item is activatable
Sourcefn is_focusable(&self) -> bool
Available on crate feature v4_12
only.
fn is_focusable(&self) -> bool
v4_12
only.Checks if a listitem has been set to be focusable via
set_focusable()
.
§Returns
true if the item is focusable
Sourcefn item(&self) -> Option<Object>
fn item(&self) -> Option<Object>
Gets the model item that associated with @self.
If @self is unbound, this function returns NULL
.
§Returns
The item displayed
Sourcefn position(&self) -> u32
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
Sourcefn is_selectable(&self) -> bool
fn is_selectable(&self) -> bool
Checks if a listitem has been set to be selectable via
set_selectable()
.
Do not confuse this function with is_selected()
.
§Returns
true if the item is selectable
Sourcefn is_selected(&self) -> bool
fn is_selected(&self) -> bool
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.
§Returns
true if the item is selected.
Sourcefn set_accessible_description(&self, description: &str)
Available on crate feature v4_12
only.
fn set_accessible_description(&self, description: &str)
v4_12
only.Sets the accessible description for the listitem.
The accessible description may be used by e.g. screen readers.
§description
the description
Sourcefn set_accessible_label(&self, label: &str)
Available on crate feature v4_12
only.
fn set_accessible_label(&self, label: &str)
v4_12
only.Sets the accessible label for the listitem.
The accessible label may be used by e.g. screen readers.
§label
the label
Sourcefn set_activatable(&self, activatable: bool)
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 WidgetExt::activate()
will activate
the item. Activating instructs the containing view to handle
activation. ListView
for example will be emitting the
activate
signal.
By default, listitems are activatable.
§activatable
if the item should be activatable
Sourcefn set_child(&self, child: Option<&impl IsA<Widget>>)
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 listitem’s child or NULL
to unset
Sourcefn set_focusable(&self, focusable: bool)
Available on crate feature v4_12
only.
fn set_focusable(&self, focusable: bool)
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, listitems are focusable.
§focusable
if the item should be focusable
Sourcefn set_selectable(&self, selectable: bool)
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, listitems 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
fn connect_accessible_description_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v4_12
only.fn connect_accessible_label_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v4_12
only.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
v4_12
only.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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.