
22 Aug
2005
22 Aug
'05
12:36 p.m.
Duncan Coutts wrote:
Most toolkits with a main loop system allow you to setup timers. In the Gtk2Hs bindings we can use this trick:
-- 50ms timeout, so GHC will get a chance to scheule about 20 times a second -- which gives reasonable latency without the polling generating too much -- cpu load. timeoutAddFull (yield >> return True) priorityDefaultIdle 50
Just for the record, above line in wxHaskell is spelled as: timer mainWindow [ interval := 50, on command := return () ] By the way, thanks for this tip! This helped me to work around showstopper bug in my program :) -- Gracjan