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: QuickDraw GX Environment and Utilities /
Chapter 1 - QuickDraw GX and the Macintosh Environment / QuickDraw GX and the Macintosh Environment Reference
Macintosh Interface Functions / Associating View Ports With Macintosh Windows


You can use the GXNewWindowViewPort function to create a new view port for a specified Macintosh window.

gxViewPort GXNewWindowViewPort(WindowPtr qdWindow);
A pointer to the window for which the new view port is to be created.
function result
A reference to the new view port.
The GXNewWindowViewPort function creates a new view port associated with the specified window. All drawing in the window view port will be clipped to the visible region of the window.

View ports associated with windows are clipped by the visible region (visRgn), but not the clip region (clipRgn) of the window. The origin of the window doesn't affect the view port. The clip shape of the view port doesn't affect drawing in the window.

You cannot alter the mapping or clip properties of view ports created with this function. Most typically, you use this function to create a view port attached to a window, and then--if you support scrolling or otherwise need to change the clip or mapping--you create one or more child view ports of the window view port and draw into them.

Do not attach more than one view port to a window through this function; unpredictable behavior results.

View ports, child view ports, and the limitations on access to window view ports are discussed in the chapter "View-Related Objects" in Inside Macintosh: QuickDraw GX Objects.

To obtain the window associated with a view port, use the GXGetViewPortWindow function, described next. To obtain the view port associated with a window, use the GXGetWindowViewPort function, described on page 1-26.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996