On 2008 Aug 22, at 15:06, Doug Nichols wrote:
> I get this message when I tried to make gtk2hs 0.9.13. I'm trying
> to build it on an old g3 ppc ibook that runs ubuntu gutsy. I have
> ghc 6.8.3 installed and working.
>
> glib/System/Glib.hs:13:0:
> Failed to load interface for 'System.Glib.UTFString':
> Use -v to see a list of the files searched for.
> make[1]: *** [glib/System/Glib.o] Error 1
The real error is before that; you'll find it failed to detect the
Glib development libraries, so didn't build the Haskell interface to
it. (I just hit this on SuSE; our clean build environment turned out
to be a touch *too* clean.)
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@...
system administrator [openafs,heimdal,too many hats] allbery@...
electrical and computer engineering, carnegie mellon university KF8NH

I get this message when I tried to make gtk2hs 0.9.13. I'm trying to build
it on an old g3 ppc ibook that runs ubuntu gutsy. I have ghc 6.8.3
installed and working.
glib/System/Glib.hs:13:0:
Failed to load interface for 'System.Glib.UTFString':
Use -v to see a list of the files searched for.
make[1]: *** [glib/System/Glib.o] Error 1
Can anyone offer any suggestions?

> Hi, everyone.
> In my current project, I use gtk2hs to build the GUI. But I meet a few
> problems. Following two is about the TreeView.
> 1. TreeView has a function named treeViewGetModel to achieve the TreeModel
> data. But there seems no way to covert this model into the concrete ones,
> such as TreeStore. This problem make the program a bit tougher, for I have
> to store the TreeStore somewhere. So I wonder why not just let the
> treeViewGetModel return the TreeStore structure?
> 2. I find updating the TreeStore is quite unefficient. On some occasion, I
> have to clear the whole treeStore and set a new forest which have over 80000
> nodes. I update the treestore with following statements:
> do MV.treeStoreClear store
> mapM_ (uncurry $ MV.treeStoreInsertTree store []) (zip [0..] forest)
> I find that it method takes over 5 seconds, and over 150MB memory. This
> realy astonished me. Could someone point me a better way?
>
> Thank you very much, and best regards.
> pierric.wu
Its recommended in the normal GTK+ docs that if you want to update the
model in a treeview, with a lot of entries in one go its best to
remove it from the view, then re-add it afterwards. I haven't tried
this with gtk2hs, but I did note that the attribute 'treeViewModel'
takes a 'Maybe TreeModel' as its type. So if I were you were you I
would try to do something like:
-- remove model
set viewName [ treeViewModel := Nothing ]
-- the following two lines are your code
MV.treeStoreClear store
mapM_ (uncurry $ MV.treeStoreInsertTree store []) (zip [0..] forest)
-- put model back in
set viewName [ treeViewModel := (Just store) ]
The reason that its slow in GTK+ is that it tries to re-render the
entire view after adding each line (which makes sense if you think
about it), but this obviously means you need to re-render 32000000
rows when you add 8000 entries in one go. BTW: massive caveat that I
haven't tested the above code.
Richard

Hi, everyone.
In my current project, I use gtk2hs to build the GUI. But I meet a few
problems. Following two is about the TreeView.
1. TreeView has a function named treeViewGetModel to achieve the TreeModel
data. But there seems no way to covert this model into the concrete ones,
such as TreeStore. This problem make the program a bit tougher, for I have
to store the TreeStore somewhere. So I wonder why not just let the
treeViewGetModel return the TreeStore structure?
2. I find updating the TreeStore is quite unefficient. On some occasion, I
have to clear the whole treeStore and set a new forest which have over 80000
nodes. I update the treestore with following statements:
do MV.treeStoreClear store
mapM_ (uncurry $ MV.treeStoreInsertTree store []) (zip [0..] forest)
I find that it method takes over 5 seconds, and over 150MB memory. This
realy astonished me. Could someone point me a better way?
Thank you very much, and best regards.
pierric.wu