For most uses of the View System, the rule for drawing is: "Don't call us, we'll call you." You never initiate a damage-repair operation. Instead, you tell the View System that part (or all) of your view is invalid, or needs to be redrawn. The View System adds areas that you couldn't know are invalid, such as a corner of your view that is exposed when another view moves, then initiates the drawing process for you. You mark areas of your view as invalid; the View System redraws the invalid areas.
This approach to redrawing views has several advantages:
- Simplicity: you don't need to determine the appropriate time to draw. If you mark areas invalid, you can count on their being redrawn at the correct time.
- Efficiency: the View System reduces the number of redrawing cycles by combining the redrawing of the areas you invalidate with the redrawing of areas that become invalid for other reasons (such as exposing a corner of the view).
- Robustness: the View System reliably redraws every view that needs redrawing. It is difficult for an individual view to manage that process itself. The system can also prioritize drawing against other operations, thereby keeping the overall system behaving properly.
You do not need to invalidate an area except when you change something that needs to be reflected on the display. The View System automatically draws your view during standard View System operations such as attaching the view to a view root, moving the view, exposing and hiding the view, resizing the view, and changing the front-to-back order of the view among its siblings.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.
Generated with WebMaker