Re: A Question about GtkTreeSortable



On Thu, 2005-10-20 at 19:12 +0200, Christian Neumair wrote:
Am Donnerstag, den 20.10.2005, 17:44 +0200 schrieb Iago Rubio:
On Thu, 2005-10-20 at 19:06 +0800, searun wrote:
Hi ,

Now i want to use GtkTreeSortable to sort a list. The first entry in the
gtk_tree_view is an information entry which needn't to be sorted, so i don't
want the GtkTreeIterCompareFunc function use the first entry. In my programe
i check GtkTreeIter, if it is the same as the first iter, the
GtkTreeIterCompareFunc will return 0.

How are you comparing those iters ?

BUT it can't work. After two day's debug, i can't find the reason.

Any help is appreciated, even if you have another good method.

Try to compare the paths with gtk_tree_path_compare() instead of
comparing the iters. I don't know a generic function to compare iters.
[snip]
Note that this will IMHO only work if the informal row is inserted into
the model before any other row.

Yes, good point. No doubt it's something to take into account.

But as he says "the first entry in the gtk_tree_view", I supposed the
tree view will be sorted only before to enter all data, with the
"special" entry as first.

What the example I posted does is to maintain the first entry - in the
model - always as first, despite of the tree view being sorted ascending
or descending.
-- 
Iago Rubio




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