
25 Jul
2009
25 Jul
'09
2:50 p.m.
Bernhard Lehnert wrote:
Hi list,
using gtk2hs I would like to count how often a Menu has been selected (well, not really, but it kind of breaks down to this):
let a = 0 onActivateLeaf menuAddOne $ do let a = a+1 print a
This leads to a stack overflow. Obviously a=a+1 is iterated over and over again. But how can I add something each time the menu is activated? (Actually I want to open a FileDialog and add the contents of a file to a list but for now, counting would be great).
Thanks to everyone for reading, Bernhard
I would suggest having a look at Control.Concurrent.MVar http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Concurren... Best, Thomas