[Haskell-cafe] gtk2hs problem
Gregory Propf
gregorypropf at yahoo.com
Wed Nov 21 17:47:59 EST 2007
OK, it actually DOES appear related to the -threaded flag. I was sure I had removed that and still seen the problem but now it seems that taking that out is indeed the fix. Using the -O2 flag is OK. I guess it's some syncronization problem when using the threaded RTS. Which is a shame because it does seem faster that way on my dual core machine. I guess I need to learn about how threading works in ghc.
Duncan Coutts <duncan.coutts at worc.ox.ac.uk> wrote: On Tue, 2007-11-20 at 15:18 -0800, Gregory Propf wrote:
> I'm using the Gtk.timeoutAddFull function to do the animation.
Are you using the threaded rts? Are you linking the program with
-threaded?
Are you doing the drawing directly in the timeout function or just
invalidating the window/widget and letting it get redrawn?
See for example the cairo clock demo which animates the hands of the
clock every second:
timeoutAdd (widgetQueueDraw window >> return True) 1000
In general it is much better to only ever draw to a window or widget
during that widget's expose event.
Duncan
---------------------------------
Get easy, one-click access to your favorites. Make Yahoo! your homepage.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071121/d5e4babb/attachment.htm
More information about the Haskell-Cafe
mailing list