Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 2 - Basic QuickDraw / Basic QuickDraw Reference
Routines


Opening and Closing Basic Graphics Ports

All graphics operations are performed in graphics ports. Before a basic graphics port can be used, it must be allocated and initialized with the OpenPort procedure. Normally, your application does not call this procedure directly. Instead, your application creates a basic graphics port by using the GetNewWindow or NewWindow function (described in the chapter "Window Manager" in Inside Macintosh: Macintosh Toolbox Essentials) or the NewGWorld function (described in the chapter "Offscreen Graphics Worlds" in this book). These functions call OpenPort, which in turn calls the InitPort procedure.

To dispose of a graphics port when you are finished using a window, you normally use the DisposeWindow procedure (if you let the Window Manager allocate memory for the window) or the CloseWindow procedure (if you allocated memory for the window). You use the DisposeGWorld procedure to dispose of a graphics port when you are finished with an offscreen graphics world. These routines automatically call the ClosePort procedure. If you use the CloseWindow procedure, you also dispose of the window record containing the graphics port by calling the Memory Manager procedure DisposePtr.


Subtopics
OpenPort
InitPort
ClosePort

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996