On 08.11.2012, at 19:48, <timothyho...@seznam.cz> wrote:

> You didn't read the comments of my source.  I cannot prepend, because I want 
> to be able to remove items as well as add them.  I think I'll end up just 
> replacing the entire tree view, and to Dickens with performance.
> 

Have a look at 

http://hackage.haskell.org/packages/archive/gtk/0.12.3/doc/html/src/Graphics-UI-Gtk-ModelView-ListStore.html

which shows you which functions are implemented. If you want to replace a list 
with the minimum distraction, you could iterate through the old and the new 
list at the same time and emit the corresponding listStoreInsert and 
listStoreRemove calls. If you're ok with replacing the whole list, call 
listStoreClear (but note that this is also linear) and then 
listStorePrependList.

You cannot replace the whole ListStore or even the ListView widget as this 
causes all sorts of havoc in the user interface.

Cheers,
Axel

> 
> 
> Timothy
> 
> 
> 
> ---------- Původní zpráva ----------
> Od: Axel Simon <axel.si...@in.tum.de>
> Datum: 8. 11. 2012
> Předmět: Re: [Gtk2hs-devel] listStoreClear , listStoreRemove, and 
> treeViewSetModel all broken?
> 
> Hi Tim,
> 
> You cannot replace the model of the view with a new one. You need to 
> modify the existing ListStore.
> 
> Could you try listStorePrependList? That looks like the most sane 
> function that is actually implemented. I admit that ListStore could 
> use some love.
> 
> Cheers,
> Axel
> 
> On 08.11.2012, at 14:56, <timothyho...@seznam.cz> wrote:
> 
> > Hey I've been playing around with 
> > http://www.haskell.org/haskellwiki/Gtk2Hs/Tutorials/TreeView 
> > and packing it up into a simple library. I'm trying to make the 
> > list updatable however, and so far all of my attempts have failed :(
> >
> > See line 45 of my attachment please.
> > <SimpleListView.hs>
> > ------------------------------------------------------------------------------
> > Everyone hates slow websites. So do we.
> > Make your web apps faster with AppDynamics
> > Download AppDynamics Lite for free today:
> > http://p.sf.net/sfu/appdyn_d2d_nov_______________________________________________
> > Gtk2hs-devel mailing list
> > Gtk2hs-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to