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 theSetGWorld
procedure.
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
GDevice
record. If you pass a pointer to an offscreen graphics world in theport
parameter, set this parameter toNIL
, becauseSetGWorld
ignores this parameter and sets the current device to the device attached to the offscreen graphics world.DESCRIPTION
TheSetGWorld
procedure sets the current graphics port to the one specified by theport
parameter and--unless you set the current graphics port to be an offscreen graphics world--sets the current device to that specified by thegdh
parameter.In the
port
parameter, 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
TheSetGWorld
procedure 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 theSetGWorld
procedure 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 theGetGWorld
procedure to save the current graphics port for an active window, theSetGWorld
procedure to change the current graphics port to an offscreen graphics world, and thenSetGWorld
again to restore the active window as the current graphics port.