Important: The information in this document is obsolete and should not be used for new development.
OpenPort
TheOpenPortprocedure allocates space for and initializes a basic graphics port. The Window Manager callsOpenPortfor each black-and-white window it creates, and theNewGWorldprocedure callsOpenPortfor every offscreen graphics world containing a basic graphics port that it creates.
PROCEDURE OpenPort (port: GrafPtr);
port- A pointer to a
GrafPortrecord.DESCRIPTION
TheOpenPortprocedure allocates space for visible and clipping regions for the graphics port specified in the port parameter, initializes the fields of the port'sGrafPortrecord as indicated in Table 2-2, and makes that graphics port the current port (by callingSetPort). The Window Manager callsOpenPortwhen 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'sNewPtrprocedure.SPECIAL CONSIDERATIONS
TheOpenPortprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.SEE ALSO
TheGrafPortrecord is described beginning on page 2-27. Listing 2-2 on page 2-15 illustrates how to use the Window Manager functionGetNewWindowto create a basic graphics port. TheOpenCPortprocedure (described in the chapter "Color QuickDraw") creates a color graphics port.