Re: Preventing sorting in a GtkTreeView/GtkListStore



I'm in the process of updating my code that uses the deprecated GtkCList 
to use GtkTreeView instead.  Lo and behold, I am running into the same problem 
that this person had back in November of 2002.

Appending a large number (10,000) rows to an unsorted GtkListStore and 
then doing a gtk_tree_sortable_set_sort_column_id() takes (in my case)
about 8 seconds.  If I then clear the GtkListStore with gtk_list_store_clear()
and try to append the same 10,000 rows it takes many minutes to finish.

Does anybody know how I can revert a GtkListStore to be unsorted so 
that I can add a large quantity of rows in a timely manner?

On Thu, 14 Nov 2002, Gian Luigi Gragnani said:
I construct a GtkTreeView with a GtkListStore as model
All the column of GtkListStore are G_STRING
I add as many GtkTreeViewColumn as the column in the GtkListStore,
so that any GtkTreeViewColumn is in a one-to-one corresponce with the
related column in the model.
Each GtkTreeViewColumn has its sort_id setted to the corrensponding 
col in the model.

At some time in the application I want to add a large number of rows
to GtkTreeeView/GtkListStore without having them automatically sorted.

When I start the application I can add rows without sort, but, as soon as I 
click
on a column header, I cannot find a way to revert to the unsorted behaviour

I tried to set the default sort func to NULL but it does not seem to work


--
Ken Rastatter, Design Engineer
Sensotec, Inc.
2080 Arlingate Lane, Columbus, Ohio, 43228-4112 USA

Voice: (614)850-5000 Fax: (614)850-6041 Toll Free: 1-800-848-6564
Home Page:  http://www.sensotec.com





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