Don't use wxWindow::ClearBackground() in the image sample and explain why.

Painting on both wxPaintDC and wxClientDC simultaneously doesn't work well,
e.g. under Windows the client DC can be actually erased after we finished
painting the window contents, overwriting it.

Simply use wxDC::Clear() instead of wxWindow::ClearBackground() to avoid this
and document the danger of using ClearBackground() from EVT_PAINT handler.

Closes #10700.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-05-10 21:02:30 +00:00
parent a29df06231
commit f6b4a1b98d
2 changed files with 9 additions and 6 deletions

View File

@@ -185,11 +185,8 @@ private:
{
wxPaintDC dc(this);
#ifndef __WXOSX__
// on OSX the immediate Update from within ClearBackground leads to a recursion
if ( GetMenuBar()->IsChecked(ID_PAINT_BG) )
ClearBackground();
#endif
dc.Clear();
dc.SetUserScale(m_zoom, m_zoom);