CompuServe Messages

Drawing in Windows

    13-Mar-94 17:42:48
Sb: #163687-Drawing in Windows
Fm: Steve Stockman 76507,2646
To: Syndesis 76004,1763
>>> Could you elaborate on the benefits of why an app should send invalidate messages immediately, and only draw when it gets the update events? <<< 1) It keeps all the drawing in one place, because you _have_ to do the drawing in response to an update event anyway. 2) It improves response to other events. During the time between first invalidating the window and actually updating it, several other events might be received. If any of these would also affect the appearance of the window in question, only the cumulative effect need be drawn when the update event comes around. Whereas drawing immediately would hold up the other events, and you would have to draw each change instead of a cumulative change. There are legitimate reasons for drawing immediately. For example, controls and control-like entities have to be partially redrawn when the mouse is pressed over them, and then redrawn again as the button is released or the mouse is dragged in and out of the area. But if you are using real controls, this redrawing is handled by TrackControl(), so you needn't worry about it. Steve