Re: Large amount of rows in a TreeView list.



csld skynet be said:
Hello,

My application should display big database tables in a TreeView list
(~10000 rows).
Because, in this case, calling the append method of Gtk2::ListStore for
each row is not very efficient, I would like to avoid to copy result
sets in this list model.

To solve this problem, the MFC CListLiew control has a callback
mechanism asking to application row data to display for only visible
rows in the list.

i don't know it to be the case, but i would suspect that one of the advantages
of the MVC arch is that you build up your model (with 10k rows) and the view
(showing maybe 30) only need ask for the info for that 30. there's nothing
keeping you from building a small list in a model and then showing that in a
view and putting callbacks on the scroll bars to move the small model through
your big list, but you kinda loose the whole point of the MVC arch then.

To have the same effect in GTK2, I think it's necessary to subclass the
Gtk2::TreeModel. But that seems me complex.

Do you know a better way or where I can find code samples demonstrating
how to subclass the Gtk2::TreeModel?

Gtk2::SimpleList is such an example, althought it only wraps it up, doesn't do
anything as fancy as what you're wanting.

i'm not sure, but 10,000 rows may be more than ListStore can take, (or the MFC
equvielent for that matter i've seen win32 progs grind to a halt once a list
gets over a few k) beyond that it's more than most people can make sense of,
but that's for you to decide.

if you don't get the answer you want here, try asking on a gtk+ list, they'll
talk to you in C, but what they tell you will be easily applied to gtk2-perl.

-rm



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]