Trait gtk::prelude::ListBoxRowExt
source · [−]pub trait ListBoxRowExt: 'static {
Show 13 methods
fn changed(&self);
fn is_activatable(&self) -> bool;
fn header(&self) -> Option<Widget>;
fn index(&self) -> i32;
fn is_selectable(&self) -> bool;
fn is_selected(&self) -> bool;
fn set_activatable(&self, activatable: bool);
fn set_header(&self, header: Option<&impl IsA<Widget>>);
fn set_selectable(&self, selectable: bool);
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_activate(&self);
fn connect_activatable_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_selectable_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}
Expand description
Required Methods
Marks self
as changed, causing any state that depends on this
to be updated. This affects sorting, filtering and headers.
Note that calls to this method must be in sync with the data
used for the row functions. For instance, if the list is
mirroring some external data set, and two rows changed in the
external data set then when you call changed()
on the first row the sort function must only read the new data
for the first of the two changed rows, otherwise the resorting
of the rows will be wrong.
This generally means that if you don’t fully control the data
model you have to duplicate the data that affects the listbox
row functions into the row widgets themselves. Another alternative
is to call ListBoxExt::invalidate_sort()
on any model change,
but that is more expensive.
fn is_activatable(&self) -> bool
fn is_activatable(&self) -> bool
fn is_selectable(&self) -> bool
fn is_selectable(&self) -> bool
fn is_selected(&self) -> bool
fn is_selected(&self) -> bool
fn set_activatable(&self, activatable: bool)
fn set_activatable(&self, activatable: bool)
Set the property::ListBoxRow::activatable
property for this row.
activatable
true
to mark the row as activatable
fn set_header(&self, header: Option<&impl IsA<Widget>>)
fn set_header(&self, header: Option<&impl IsA<Widget>>)
fn set_selectable(&self, selectable: bool)
fn set_selectable(&self, selectable: bool)
Set the property::ListBoxRow::selectable
property for this row.
selectable
true
to mark the row as selectable
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
This is a keybinding signal, which will cause this row to be activated.
If you want to be notified when the user activates a row (by key or not),
use the signal::ListBox::row-activated
signal on the row’s parent ListBox
.