Re: GtkClist sorting
| From: | Cosmin | Date: | Wed, 03 Mar 2004 10:55:21 +0000 |
| Subject: | Re: GtkClist sorting | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4439@lists.php.net to get a copy of this message | ||
On Wed, 2004-03-03 at 12:18, Cosmin wrote:
> Hello
> I'm stuck with the following situation:
> I have a cList with a column containing only integers. When I sort the
> list I get something like 1,10,2,3 ... I've searched the mailing list
> archive and I found out that GtkCList::sort() uses the "natural order"
> algorithm. I know I can use PHP to sort the list and then display it the
> way I want, but I want to know if there isn't another way to do this.
For those who are still looking for a solution to this problem, i've
found a workaround:
Before adding the integer to the list add some spaces like this:
$integerValue = str_pad($i, 10, ' ', STR_PAD_LEFT);
Unfortunately this doesn't work for float values
If you have other solutions I'll be glad to see them
Cosmin Budinschi <cosminb@as.ro>
Web Developer