Important: The information in this document is obsolete and should not be used for new development.
Window Records
Each window has a number of descriptive characteristics such as a title, control list, and visibility status. The Window Manager stores this information in a window record, which is a data structure of typeWindowRecord
.
The window record is described in detail in "The Color Window Record" beginning on page 4-65.
- the window's graphics port data structure
- the window's class, which specifies whether it was created directly through the Window Manager or indirectly through the Dialog Manager
- the window title
- a series of flags that specify whether the window is visible, whether it's highlighted, whether it has a zoom box, and whether it has a close box
- pointers to the structure, content, and update regions
- a handle to the window's definition function
- a handle to the window's control list
- an optional handle to a picture of the window's contents
- a reference constant field that your application can use as needed
The first field in the window record is the window's graphics port. The
WindowPtr
data type is therefore defined as a pointer to a graphics port.
TYPE WindowPtr = GrafPtr;You draw into a window by drawing into its graphics port, passing a window pointer to the QuickDraw drawing routines. You also pass window pointers to most Window Manager routines.You don't usually need to access or directly modify fields in a window record. When you do, however, you can refer to them through the
WindowPeek
data type, which is a pointer to a window record.
TYPE WindowPeek = ^WindowRecord;The close box, drag region, zoom box, and size box are not included in the window record because they don't necessarily have the formal data structure for regions
as defined in QuickDraw. The window definition function determines where these regions are.Your application seldom accesses a window record directly; the Window Manager automatically updates the window record when you make any changes to the window, such as changing its title. The Window Manager also supplies routines for changing and reading some parts of the window record.