X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a660d684eda27638bca0384b2058911a31c8e845..2fd284a4a09793c29078296529d3e9db5acd0a0f:/docs/latex/wx/paintdc.tex?ds=sidebyside 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.