Repainting of windows

All windows except for the canvas are repainted by the system. The canvas requires a paint message handler to be defined (and therefore canvas derivation is obligatory). Under XView and Motif, wxWindows allows a canvas to be retained if desired, which means that fewer paint messages are received and scrolling is fast. The Motif implementation has a slight overhead in that drawing must be done both to the canvas and to the backing pixmap, but this is usually made up for by the speed of repainting.

The repaint procedure will obviously be written in such a way that the minimum amount of work needs to be done (for example, positions of objects on a canvas are only recalculated when the positions change).

See Scrolling for more information on repainting and scrolling.