Important: The information in this document is obsolete and should not be used for new development.
SetPort
To change the current graphics port (basic or color), you can use theSetPortprocedure.
PROCEDURE SetPort (port: GrafPtr);
port- A pointer to a
GrafPortrecord. Typically, you pass a pointer to aGrafPortrecord that you previously saved with theGetPortprocedure (described in the previous section).DESCRIPTION
TheSetPortprocedure sets the current graphics port (pointed to by the global variablethePort) to be that specified by theportparameter. All QuickDraw drawing routines affect the bitmap of, and use the local coordinate system of, the current graphics port. Each graphics port has its own graphics pen and text characteristics, which remain unchanged when the graphics port isn't selected as the current graphics port.SEE ALSO
Listing 2-3 on page 2-16 illustrates how to useGetPortto save the graphics port for the active window andSetPortto make an inactive window the current graphics port; then how to useSetPortagain to restore the active window as the current graphics port. The basic graphics port is described on page 2-27. TheGetPortprocedure is described on page 2-39.When your application runs in Color QuickDraw or uses offscreen graphics worlds, it should use the
SetGWorldprocedure instead ofSetPort. TheSetGWorldprocedure restores the current graphics port for basic and color graphics ports as well as offscreen graphics worlds. See the chapter "Offscreen Graphics Worlds" for more information.