[pygtk] How can I suppress redraw of a gtk.ScrolledWindow and children until I'm done changing stuff?

John Finlay finlay at moeraki.com
Mon Oct 27 03:34:05 WST 2008


Joel Hedlund wrote:
> Hi all!
>
> I've got a large widget (W) in an alignment in a viewport in a small 
> scrolledwindow (S). S overrides the do_scroll_event method, so that 
> ctrl-scroll zooms by doing W.set_size_request(). Since what's under the 
> mouse pointer should stay put and not be scrolled off the screen as W 
> resizes, the values on the adjustments on S need to be changed to 
> compensate.
>
> Now, my problem. GTK redraws after W.set_size_request() and after 
> S.props.vadjustment.set_value(), making zooming a very flickery and 
> migraine inducing experience that I don't want to subject my users to.
>
> So, how can I suppress redraws on a gtk.ScrolledWindow and its children 
> until I'm done changing stuff?
>   
Try:

http://pygtk.org/docs/pygtk/class-gdkwindow.html#method-gdkwindow--freeze-updates

John


More information about the pygtk mailing list