The “little black square” issue mentioned in the thread
“Oddness with wx.Notebook”
https://groups.google.com/forum/#!topic/wxpython-users/NRAXzaPU5d8 ,
and the earlier thread linked from that one, seems to not be confined
to wx.Notebook-based applications.
The attached sample application produces a square of around 20x20 pixels in
the top left corner of a wx.Frame, or its child wx.Panel, without any
wx.Notebook instance.
The attached application simply toggles between displaying one of two
different blue-gray colored images (after the user presses a key). The square
is clearly visible in the top left corner while toggling is in progress.
When the user presses a key a second time, the toggling stops, and the final
image is displayed correctly.
The color of the “little square” seems to depend on the background color of the
frame or panel that is the parent of the wx.StaticBitmap.
For convenience, the application defines some variables at the top that control
various different tests I tried.
I also experimented with binding the EVT_ERASE_BACKGROUND event to an empty
function, but it did not noticably affect the displayed bitmaps.
I have obtained the same result on two different systems, using Python 3.5.2,
wx.Python 4.0.0b2 on a 64-bit Windows 7 PC. One system was a desktop, and the
other a laptop, which may imply that the suggestion that it is a graphics
driver issue is unlikely.
The CallAfter() suggestion from Tim is not applicable in this context where the
square is visible long after Frame1.init’s work is done.
The application is intended to be a MWE - in my real application, I’m capturing
images off a camera and displaying them in a bitmap.
Any ideas on how to get around the little squares will be gratefully
implemented
little_square.py (4.71 KB)