[wxPython] ListBoxControl flashing, a question

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] ListBoxControl flashing, a question

Mike  Fletcher
In the attached file, I (rather crudely) attempt to eliminate the strobing
effect in list boxes by defining the following method in my list-box derived
control.

        def OnEraseBackground( self, event ):
                '''Try to eliminate flashing'''
                pass

It does, indeed, prevent the strobing effect (or at least reduces it to a
barely-perceptible flickering when large numbers of repaints are coming in).
Unfortunately, it also demonstrates that the list control relies very
heavily on its background-drawing routine (it leaves any area not covered by
a column un-touched, as well as a thin border on the left and top sides
(inside the border)).  I'm wondering if anyone has a simpler solution than
re-writing to eliminate painting over the foreground area (columns) during
the background clearing process?

Enjoy yourselves,
Mike


testflash.py (1K) Download Attachment