Re: GTKClist Sorting

From: Date: Tue, 21 Mar 2006 21:47:31 +0000
Subject: Re: GTKClist Sorting
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-6805@lists.php.net to get a copy of this message
At 05:24 PM 3/21/2006, Neil Eisgruber wrote:
Hello, I am currently writing a gtk program that has a GtkCList. This list contains Dates and numbers so the built in sorting was not working correctly. I found the bubblesort algorithm on the help pages, but that turned out to be really slow (as expected). After that I wrote a quicksort algorithm which allowed me to sort a bit quicker then the bubble sort. The problem is that I am trying to sort thousands, or maybe even a million records. Has anyone found a way to do this more quickly? Is there any way that I could compile a library to do that? If so are there any tutorials or anything that could help me? On a side note, when I sort the records using the built in functionallity (non natural sorting) it works quickly... Thanks for any help! Neil
Neil, How are you filling the list? If it's from a database, requery, ordering in your SELECT statement and reload the list. What about re-ordering your dates to yyyy-mm-dd? If the numbers are of type char, try left padding with zeroes. Actually, if it's millions of rows, won't you have to page your data, or control it in some other way? Makes a good case for a native browse window connected directly a view. This probably hasn't been much help. Regards - Miles -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.385 / Virus Database: 268.2.6/286 - Release Date: 3/20/2006

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