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: timothyho...@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: timothyho...@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.si...@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, <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
(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/Gtk
2Hs/Tutorials/TreeView
(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______________________________________
_________
(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
(https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel)"
"
"
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to