Drawing outside of windows from within an application is guaranteed to make that application less compatible with future systems. In order to be as MultiFinder compatible as possible, draw only in response to an update event or as part of the feedback for a user action, i.e. while tracking the mouse. MultiFinder compatibility is just as important as HFS compatibility!
MultiFinder documentation warns against drawing in
In the future the system may provide calls for drawing outside your windows safely. When that occurs, the techniques described here may no longer be valid. Nevertheless....
WMgrPort and GrayRgn
Note that you should use
Only draw to the whole screen/desktop in a "modal" way. This can take the form of a brief animation across windows or the visual feedback for dragging from one window to another. It is important to know that no other application (including the Finder) will draw until you have finished. To guarantee this, you must follow some rules:
In the case of a drag, you should only draw while the mouse button is down. In
the case of an animation effect, the drawing should be of brief duration. All
operations should conclude with nothing left drawn outside your windows. Under
MultiFinder (version 1.0 and 6.0 at least) you will be OK if you don't call
Never draw something on the desktop and leave it there. There is no way to tell the system that you have drawn on that bit of desktop, so the Finder will draw right over you.
The most famous animation effect is the
Another, potentially more interesting, case is where you want to drag something
from one window to another, perhaps to copy it. This is often done with
How to do these effects
WDEFs and MDEFs
Window and menu definition procedures draw in the current port, which is set to
The Window Manager
MultiFinder Development Package
Contact ADC | ADC Site Map | ADC Advanced Search
|For information about Apple Products, please visit Apple.com.|
Contact Apple | Privacy Notice
Copyright © 2002 Apple Computer, Inc. All rights reserved.