
Thanks for the quick answers. I dont really know, what timer functions there are, I googled "timing, scheduling, delaying in haskell", but the only function I found, was threaddelay. How did you mean "adding a timer"? On the other side, I checked Graphics.UI.Gtk.Gdk.drawWindowProcessUpdates. I guess, I should use this in the function, where I draw something, and wait, and draw something else, and I should put it between the two drawing steps to get an immediate update. If I do so, the drawing gets blocked again, and nothing happens for some second, and then everything is drawn at the same time. Sorry, I m a very beginner at this topic.

On Mon, Dec 26, 2011 at 8:33 AM,
Thanks for the quick answers.
I dont really know, what timer functions there are, I googled "timing, scheduling, delaying in haskell", but the only function I found, was threaddelay. How did you mean "adding a timer"?
This is Gtk+ stuff, since the main loop is there. I'm talking about using timeoutAdd [1]. Note that although the docs begin by saying that the function is called at regular intervals, you just need to make sure to return False to avoid that. [1] http://hackage.haskell.org/packages/archive/glib/0.12.2/doc/html/System-Glib...
On the other side, I checked Graphics.UI.Gtk.Gdk.drawWindowProcessUpdates. I guess, I should use this in the function, where I draw something, and wait, and draw something else, and I should put it between the two drawing steps to get an immediate update. If I do so, the drawing gets blocked again, and nothing happens for some second, and then everything is drawn at the same time.
Even if you're able solve this particular problem, your application still won't be processing events. It will feel slugish and it's possible that the window manager may decide that it has crashed. Cheers, -- Felipe.

On Mon, Dec 26, 2011 at 05:33,
I dont really know, what timer functions there are, I googled "timing, scheduling, delaying in haskell", but the only function I found, was threaddelay. How did you mean "adding a timer"?
http://hackage.haskell.org/packages/archive/gtk/0.12.2/doc/html/Graphics-UI-...
On the other side, I checked Graphics.UI.Gtk.Gdk.**drawWindowProcessUpdates. I guess, I
It may not actually be the right function. Felipe was however correct in that it's the wrong way to go about it; see the above to add a callback that executes after a delay, *without locking up the UI* which is what the threadDelay method will do. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On Mon, Dec 26, 2011 at 8:45 AM, Brandon Allbery
http://hackage.haskell.org/packages/archive/gtk/0.12.2/doc/html/Graphics-UI-...
Note that this is a re-export of the function I've linked on my e-mail, so don't worry about having to choose which one you'll use =). Cheers, -- Felipe.
participants (3)
-
Brandon Allbery
-
Felipe Almeida Lessa
-
gabre@caesar.elte.hu