|
From: | Michel Van den Bergh |
Subject: | Re: [XBoard-devel] gtk-branch |
Date: | Fri, 11 Nov 2011 21:33:24 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 |
On 11/11/2011 08:25 PM, John Cheetham wrote:
To be honest, if you experience this, I think you are doing something wrong.I think it is a fairly common problem in GTK when doing screen updates in a loop that they don't get updated on the screen straight away but wait for the next main loop
A long time ago I wrote a little game in PyGTK (pytraffic) which also used a bit of animation. I did not experience any such unpredictable behaviour. GTK is really stable if used correctly. I was not using cairo then (it did not exist) but from looking at the examples on the web the same principles for doing animation still hold.
(1) All drawing should be done in the callback to an expose event.(2) To trigger drawing generate an expose event using gtk_widget_queue_draw_area (in PyGTK this is called invalidate_rect for some reason). (3) If necessary use a timer created by g_timeout_add to generate the expose events asynchronously.
[Prev in Thread] | Current Thread | [Next in Thread] |