[Gtk-sharp-list] Adding a Lot of Rows into a TreeView

David Anes david.anes at gmail.com
Mon Mar 5 17:24:29 EST 2007


Hi again  KLessou.


2007/3/5, KLessou <klessou at gmail.com>:
>
>
>
> On 3/5/07, KLessou <klessou at gmail.com> wrote:
> >
> > Thx,
> >
> > Can I create a temporary TreeStore to keep the possibility to select old
> > TreeIter during the work ?
> >
> > Like this :
> >
> > TreeStore tmpstore = new TreeStore (store);
> >
> > _treeview.Model = tmpstore;
> >
> > while (xxx)
> > {
> >    ...
> >
> >     store.Append (out iter);
> >     store.SetValue (iter, 0, imagePreview);
> >     store.SetValue (iter, 1, description);
> > }
> >
> > _treeview.Model = store;
>
>
Yes, at the expense of double the memory used by the use of 2 treestores.

If you have many items, have you thought in implementing virtual TreeViews?
Somebody here could help you do using them? I did never used those.

Cheers,
David Anes.

On 3/5/07, David Anes <david.anes at gmail.com> wrote:
> > >
> > > Hi Klessou.
> > >
> > > Detach the model from the TreeView, add all rows, attach the model
> > > again. This will prevent relayout of the treeview on every row insertion.
> > >
> > > Cheers,
> > > David Anes.
> > >
> > > 2007/3/5, KLessou <klessou at gmail.com>:
> > > >
> > > > Hello,
> > > >
> > > > I have to insert a rows into a TreeView. Long time even on powerful
> > > > machines once the model contains more than a couple of thousand rows, the
> > > > insertion rate decreasing exponentially.
> > > >
> > > > Is there any solution to increase the insertions' rate ?
> > > >
> > > > --
> > > > ~~~~~
> > > > | klessou |
> > > > ~~~~~
> > > > _______________________________________________
> > > > Gtk-sharp-list maillist  -   Gtk-sharp-list at lists.ximian.com
> > > > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> > > >
> > > >
> > >
> >
> >
> > --
> > ~~~~~
> > | klessou |
> > ~~~~~
>
>
>
>
> --
> ~~~~~
> | klessou |
> ~~~~~
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20070305/41ff64a9/attachment.html 


More information about the Gtk-sharp-list mailing list