What basic pattern should I follow when using a DrawingArea?
The DrawingArea (and drawing in GTK+ in general) is peculiar in the sense that you never draw directly to the widget. Instead, you tell the X server the widget needs to be drawn, then the X server calls you back telling you to draw an area of your widget. This important because if you don’t follow this pattern, either what you draw won’t be displayed, or it will fail to redraw when the window is covered and subsequently uncovered. The key to this pattern is the ‘expose-event’ signal.