Re: force re-sort



On Sat, 2005-07-23 at 21:26 +0200, Jens Luedicke wrote:

I have a config option to tell my app to use case insensitive sorting or
not. I the user changes the option I want that the tree is resorted.

If column Name is sorted ascending, the treeview ignores it if I set
column Name to be sorted ascending. ascending -> descending -> ascending
is a bit dirty to get the change applied.

gtk+ 2.6 introduced GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID (-2) which
you can use for the sort column id to make the model "unsorted", i.e.
make it keep the current order but not sort newly added nodes.  After
you set it, you can switch back to your real sort column id.

Simply using GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID (-1) might also
work.

-- 
Bye,
-Torsten




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]