[wxPython-users] evt_size question

Christopher Barker Chris.Barker at noaa.gov
Thu Sep 7 09:27:36 PDT 2006


Michele Petrazzo wrote:
> Hi list,
> is possible to say to wx to not call, or better call only one time the
> paint event on size event? wx call paint two times on win and "a lot of
> times" (every pixel move?) on linux.

This is a "feature" of the window manager, rather than wx. In Windows, 
and in a lot of *nix window manager, you can set a property that sets 
whether you want the contents of Windows to be displayed as they are 
re-sized. However, you have to set it system-wide, not just for a 
particular app.

If you have an app that takes a while to Paint, it gets pretty ugly. The 
solution is to set (and re-set) a timer in EVT_SIZE, and only re-paint 
when the timer completes.

This is done in wx.lib.floatcanvas, if you want a sample. It's pretty 
easy really. but sure feels like a Kludge.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list