GtkListStore and Sql tables

From: Date: Tue, 21 Feb 2006 22:14:39 +0000
Subject: GtkListStore and Sql tables
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-6768@lists.php.net to get a copy of this message
Hi all, I'm currently wondering what the most efficient method to load mysql table contents into a gtkliststore. Loading the columns and choosing the right data type is already done, but the actual data is giving me headaches. If I have a table with 20.000 rows, loading them all on program startup would be too slow. Ideally, the store should be loading them on demand (e.g. when they need to be displayed because the user scrolled). Now one idea would be to get the number of rows from the table and create dummy rows in the store. Then I'd write my own cell data func, and whenever a unloaded row occurs, a query is made. That would be real on-demand loading. Disadvantage of that approach is that thousands of single queries are made when the list is sorted or searched. So it seems as if loading all is required, or provide "previous" and "next" buttons like in phpmyadmin. Any thoughts on this subject? Did I miss an obvious solution? Does somebody has experience with this problem? -- Regards/MfG, Christian Weiske

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