Important: The information in this document is obsolete and should not be used for new development.
SetGWorld
To change the current graphics port (basic, color, or offscreen), use theSetGWorldprocedure.
PROCEDURE SetGWorld (port: CGrafPtr; gdh: GDHandle);
port- A pointer to an offscreen graphics world, color graphics port, or basic graphics port.
gdh- A handle to a
GDevicerecord. If you pass a pointer to an offscreen graphics world in theportparameter, set this parameter toNIL, becauseSetGWorldignores this parameter and sets the current device to the device attached to the offscreen graphics world.DESCRIPTION
TheSetGWorldprocedure sets the current graphics port to the one specified by theportparameter and--unless you set the current graphics port to be an offscreen graphics world--sets the current device to that specified by thegdhparameter.In the
portparameter, you can specify values of typeGrafPtr,CGrafPtr, orGWorldPtr, depending on whether you want to set the current graphics port to be a basic graphics port, color graphics port, or offscreen graphics world. Any drawing your application performs then occurs in this graphics port.SPECIAL CONSIDERATIONS
TheSetGWorldprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSetGWorldprocedure are
Trap macro Selector _QDExtensions $00080006 SEE ALSO
Listing 6-1 on page 6-5 and Listing 6-2 on page 6-10 illustrate how to use theGetGWorldprocedure to save the current graphics port for an active window, theSetGWorldprocedure to change the current graphics port to an offscreen graphics world, and thenSetGWorldagain to restore the active window as the current graphics port.