I have a wx.Frame that has several wx.Panel's that do custom drawing. A
couple of them take a bit of time to draw. The result is that on a resize
(under windows), the various components update to the screen at different
times. This is pretty distracting ... and it results in some choppy looking
windows before the redraws complete (occurring over a couple of seconds).
Note: I am using a timer within the wx.EVT_SIZE event that only performs the
drawing if the resizing pauses long enough. But this is not the issue as
the choppy redraws occur regardless when the window finally gets its paint
events.
1. Do I have any control of how or when paint events are sent to the various
components in the frame? Since (to my understanding) wx.EVT_PAINT is not a
CommandEvent - they then do not propagate. Therefore, the underlying
platform must tell the top most window to paint ... and it must somehow send
out paint events throughout the hierarchy. This is a guess on my part ...
and am curious as to how the various paint events actually get generated and
distributed. (an explanation or a reference would be great as I have not
been able to understand this looking at references online)
2. I know that when using a BufferedDC ... it blits the buffer to the screen
when all references to the DC disappear. One idea that I had was to force
all of the draws to the screen at the very end. I would accomplish this by
storing dc's until all components were done drawing ... and then deleting
all of them in succession at the end. The challenge is how I would do this
easily and safely? All of the paint methods are distributed in several
places, I would need a central manager that would store and then delete
these. And worse yet - how would I know when all of the paint events were
finished? This seems like a bad approach. I know I have also seen warnings
against storing dcs as well. Is there any other way to get everything to go
to the screen at once? I want to get rid of all of the choppy arrivals from
the various components.
···
--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/removing-pauses-in-paiting-tp4725598p4725598.html
Sent from the wxPython-users mailing list archive at Nabble.com.