Re: [gtk-list] gtk_clist_set_sort_column (?)



You are misunderstanding what gtk_clist_set_sort_column() does...
One thing you should understand is that the CList is a list of ROWS.  Not columns.

Your data exists as a group of rows.  When you change set_sort_column()
all you are doing is telling the CList what column to use to sort the ROWS.
The whole row, and nothing but the row...  To manipulate columns
independantly of row, you should have that data in a seperate CList.
If the contents of column 3 are not associated with col's 1 and 2, then they
should not be in the same CList.

-Steve

> Hi,
> 
> I am kinda phreak'n out here, all I want to do is sort <n> column of my
> clist I made.  It keeps on sorting column 0 (first column) no matter what
> I do. Using gtk version 1.2.5.
> 
> Code snippet (trying to sort column 4 or any column minus 0):
> 
>    gtk_clist_set_sort_column(GTK_CLIST(main_clist), 3);
>    gtk_clist_set_sort_type(GTK_CLIST(main_clist), GTK_SORT_ASCENDING);
>    gtk_clist_set_compare_func(GTK_CLIST(main_clist), 
> (GtkCListCompareFunc)MyStrcmp);
>     gtk_clist_set_auto_sort(GTK_CLIST(main_clist), TRUE);
> 
> Did I miss/mess up something?
> 
> Paul
> 
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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