pub trait TreeSortableExtManual: 'static {
    // Required methods
    fn set_default_sort_func<F>(&self, sort_func: F)
       where F: Fn(&Self, &TreeIter, &TreeIter) -> Ordering + 'static;
    fn set_sort_func<F>(&self, sort_column_id: SortColumn, sort_func: F)
       where F: Fn(&Self, &TreeIter, &TreeIter) -> Ordering + 'static;
    fn sort_column_id(&self) -> Option<(SortColumn, SortType)>;
    fn set_sort_column_id(&self, sort_column_id: SortColumn, order: SortType);
    fn set_unsorted(&self);
}
Expand description

Trait containing manually implemented methods of TreeSortable.

Required Methods§

source

fn set_default_sort_func<F>(&self, sort_func: F)where F: Fn(&Self, &TreeIter, &TreeIter) -> Ordering + 'static,

Sets the default comparison function used when sorting to be @sort_func. If the current sort column id of @self is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using this function.

If @sort_func is None, then there will be no default comparison function. This means that once the model has been sorted, it can’t go back to the default state. In this case, when the current sort column id of @self is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.

Deprecated since 4.10
sort_func

The comparison function

source

fn set_sort_func<F>(&self, sort_column_id: SortColumn, sort_func: F)where F: Fn(&Self, &TreeIter, &TreeIter) -> Ordering + 'static,

Sets the comparison function used when sorting to be @sort_func. If the current sort column id of @self is the same as @sort_column_id, then the model will sort using this function.

Deprecated since 4.10
sort_column_id

the sort column id to set the function for

sort_func

The comparison function

source

fn sort_column_id(&self) -> Option<(SortColumn, SortType)>

Fills in @sort_column_id and @order with the current sort column and the order. It returns true unless the @sort_column_id is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.

Deprecated since 4.10
Returns

true if the sort column is not one of the special sort column ids.

sort_column_id

The sort column id to be filled in

order

The SortType to be filled in

source

fn set_sort_column_id(&self, sort_column_id: SortColumn, order: SortType)

Sets the current sort column to be @sort_column_id. The @self will resort itself to reflect this change, after emitting a GtkTreeSortable::sort-column-changed signal. @sort_column_id may either be a regular column id, or one of the following special values:

  • GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function will be used, if it is set

  • GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur

Deprecated since 4.10
sort_column_id

the sort column id to set

order

The sort order of the column

source

fn set_unsorted(&self)

Implementors§