That's not to say that ListStore isn't nearly completely broken in GTK2HS.  All the bugs I mentioned earlier still stand.  It's just that I got my hack working again ;)

Tim


---------- Původní zpráva ----------
Od: timothyhobbs@seznam.cz
Datum: 14. 11. 2012
Předmět: Re: Re: Re: [Gtk2hs-devel] listStoreClear , listStoreRemove, and treeViewSetModel all broken?

Actually,
the code I posted does work.  There was just a nasty little bug elsewhere in the program, that was causing the list to be updated(deleted)(and thus defocused) every time an item was selected(thus making it impossible to focus).

Thanks for reading,

and sorry for wasting time.


Timothy


---------- Původní zpráva ----------
Od: timothyhobbs@seznam.cz
Datum: 14. 11. 2012
Předmět: Re: Re: [Gtk2hs-devel] listStoreClear , listStoreRemove, and treeViewSetModel all broken?

Please,

is there any other way to do this?  I'm having weird behaviour from the destruction/recreation loop.  For some reason I end up with treeviews that display properly but cannot be focused :(


Timothy

---------- Původní zpráva ----------
Od: timothyhobbs@seznam.cz
Datum: 8. 11. 2012
Předmět: Re: [Gtk2hs-devel] listStoreClear , listStoreRemove, and treeViewSetModel all broken?

Sorry,
None of your suggestions work :(  Thank you much for your help.  Take a look at my attachment and at updateList5.  It works, though I bet it leaks memory.

As I have said before listStoreRemove and listStoreClear do not work at all!  They both error out with a empy list error.

Timothy


---------- Původní zpráva ----------
Od: Axel Simon <Axel.Simon@in.tum.de>
Datum: 8. 11. 2012
Předmět: Re: [Gtk2hs-devel] listStoreClear , listStoreRemove, and treeViewSetModel all broken?

On 08.11.2012, at 19:48, <timothyhobbs@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.Simon@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, <timothyhobbs@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