Re: GtkTreeView, database and load data on demand
| From: | Christian Weiske | Date: | Thu, 26 Nov 2009 20:35:09 +0000 |
| Subject: | Re: GtkTreeView, database and load data on demand | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-8440@lists.php.net to get a copy of this message | ||
Hello Alexander,
> Hm, I think my explaination was not really clear. :-)
It was actually very clear.
> For example, I had a table with 300000 rows, and I want them to view
> in a TreeView over a slow WAN link.
> To save time, bandwidth and memory it would be great to load only a
> part of the whole data, that part that is needed
> to draw the TreeView on the screen.
Yep, and I was talking about that. Note that I am talking about
php-gtk2.
> To do this, I need at least:
> * the Rows that are currently on the screen
> * signals on scrolling/resizing of the TreeView to load the
> needed Data from the DB
> * manupulating the scrollbar
You do not need any of this, because the treeview automatically does
this for you.
The only thing you need to do is adding dummy rows to your GtkListStore
and have your cell renderer fetch the row data from database that is
going to be displayed.
--
Regards/Mit freundlichen Grüßen
Christian Weiske
-= Geeking around in the name of science since 1982 =-
Attachment: [application/pgp-signature] signature.asc
Attachment: [application/pgp-signature] signature.asc