X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a660d684eda27638bca0384b2058911a31c8e845..4ce81a75efb34de9f01fe3c7b9ffecb03293b1c3:/docs/latex/wx/paintdc.tex diff --git a/docs/latex/wx/paintdc.tex b/docs/latex/wx/paintdc.tex index e1c416044b..05842fb646 100644 --- a/docs/latex/wx/paintdc.tex +++ b/docs/latex/wx/paintdc.tex @@ -3,7 +3,12 @@ A wxPaintDC must be constructed if an application wishes to paint on the client area of a window from within an {\bf OnPaint} event. This should normally be constructed as a temporary stack object; don't store -a wxPaintDC object. +a wxPaintDC object. If you have an OnPaint handler, you {\it must} create a wxPaintDC +object within it even if you don't actually use it. + +Using wxPaintDC within OnPaint is important because it automatically +sets the clipping area to the damaged area of the window. Attempts to draw +outside this area do not appear. To draw on a window from outside {\bf OnPaint}, construct a \helpref{wxClientDC}{wxclientdc} object.