Important: The information in this document is obsolete and should not be used for new development.
OpenPort
TheOpenPort
procedure allocates space for and initializes a basic graphics port. The Window Manager callsOpenPort
for each black-and-white window it creates, and theNewGWorld
procedure callsOpenPort
for every offscreen graphics world containing a basic graphics port that it creates.
PROCEDURE OpenPort (port: GrafPtr);
port
- A pointer to a
GrafPort
record.DESCRIPTION
TheOpenPort
procedure allocates space for visible and clipping regions for the graphics port specified in the port parameter, initializes the fields of the port'sGrafPort
record as indicated in Table 2-2, and makes that graphics port the current port (by callingSetPort
). The Window Manager callsOpenPort
when you create a black-and-white window; you normally won't call it yourself. You can create the graphics port pointer with the Memory Manager'sNewPtr
procedure.
SPECIAL CONSIDERATIONS
TheOpenPort
procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.SEE ALSO
TheGrafPort
record is described beginning on page 2-27. Listing 2-2 on page 2-15 illustrates how to use the Window Manager functionGetNewWindow
to create a basic graphics port. TheOpenCPort
procedure (described in the chapter "Color QuickDraw") creates a color graphics port.