[pygtk] Re: How to Tell Window to Redraw

Nikolaus Rath Nikolaus at rath.org
Mon Apr 7 03:27:55 WST 2008


Nikolaus Rath <Nikolaus at rath.org> writes:
> Hello,
>
> I want to write a small script that shows a number of bodies moving in
> a 2d coordinate systems. The positions at different times are stored
> in a csv file. Since I have wanted to learn some python for quite some
> time I have decided to try this in pygtk.
[...]

I have gotten the solution from a helpful guy in IRC:

The proper way to send the event would be to call

    event = gtk.gdk.Event(gtk.gdk.EXPOSE)
    emit("expose-event", event)

but the better solution is to simply call the gtk.Widget method
queue_draw().

Best,

   -Nikolaus

-- 
 Nikolaus at rath.org | College Ring 6, 28759 Bremen, Germany
 Class of 2008 - Physics | Jacobs University Bremen

 »My opinions may have changed, but not the fact that I am right.«



More information about the pygtk mailing list