R: [PHP-GTK] Re: clist sorting

From: Date: Mon, 25 Aug 2003 07:20:27 +0000
Subject: R: [PHP-GTK] Re: clist sorting
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-3730@lists.php.net to get a copy of this message
The function applies the "natural" order to the items. You should use this list: 01 02 03 04 05 06 07 08 09 10, ... zero filled (sprintf). 01 < 10 but 1 < 10 < 2 bye Dimitri Giardina System Administrator & Internet Programmer CD Informatica Srl. Chieti Scalo (CH) [ ITALY ] > -----Messaggio originale----- > Da: Aaron [mailto:aragorn@gamer.net.nz] > Inviato: giovedi 7 agosto 2003 14.36 > A: php-gtk-general@lists.php.net > Oggetto: [PHP-GTK] Re: clist sorting > > > The method "set_compare_func" allows you to write the comparison > function. Andrei said he was planning on adding it sometime, I don't > know if it will be before GTK 2 is implemented though :/ > > Tony Leake wrote: > > When I sort a clist using the following code: > > > > $clist->set_sort_type(GTK_SORT_DESCENDING); > > $clist->set_sort_column($column); > > > > $clist->sort(); > > > > it sorts a list of integers (0-10) as follows > > 9 > > 8 > > 7 > > 6 > > 5 > > 4 > > 3 > > 2 > > 10 > > 1 > > 0 > > > > I guess it thinks they're strings, how can I fix this > > > > thanks > > Tony > > > > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.gtk.general (#3730) next »