[pygtk] Updating a window

Michael Urman murman at gmail.com
Wed Jun 23 08:46:27 WST 2010


On Tue, Jun 22, 2010 at 18:33, Brian Rowlands (Greymouth High School)
<RowlandsB at greyhigh.school.nz> wrote:
> The issue I have is that the outline of the window appears with the inside
> blank until do_stuff() completes when the window is fully defined.
>
> If I have:
>
> gtk.main()
> do_stuff()
>
> then the window appears fine but nothing gets done.
>
> Don’t know if there is a command to update a window.
>
> Probably simple. If not, a reference/pointer would be appreciated.

The right answer really depends on what sort of things you are doing
inside do_stuff. If it's work that makes sense to move piecewise to
signal handlers, then do that. If it's a batch of work with convenient
locations to do event processing (say every time through a loop), call
gtk.main_iteration() from time to time, possibly within a while
gtk.events_pending().

Welcome to event-based programming!
-- 
Michael Urman


More information about the pygtk mailing list