![]() |
PATH![]() |
![]() ![]() |
The following Window Manager data types are new, changed, or not recommended with Mac OS 8 or Appearance Manager 1.0:
In Mac OS 8, you should use the color window structure instead of the window structure, since Color QuickDraw is always available with Mac OS 8. The WindowRecord structure is not recommended with Mac OS 8 and later.
The WinCTab (window color table) structure is not recommended with Appearance Manager 1.0 and later. When the Appearance Manager is available and you are using standard windows, all information in the window color table structure is ignored except the part identifier constant wContentColor in the value field of the ColorSpec structure. This constant produces the background color for the window's content region. If your are creating your own custom window definition functions, the window color table structure can still be used.
The AuxWinRec (auxiliary window) structure is not recommended with Appearance Manager 1.0 and later. When the Appearance Manager is available and you are using standard windows, most of the fields of the auxiliary window structure are ignored. In the future, standard system windows may not have entries in the auxiliary window list. If you are creating your own window definition function, the auxiliary window structure can still be used.
The window resource is changed with Appearance Manager 1.0 to support the Window Manager's new, standard window types. See Window Definition IDs for a description of the Appearance-compliant window types.
You typically define a window ( 'WIND' ) resource for each type of window that your application creates. Use GetNewWindow or GetNewCWindow to create a window based on a 'WIND' resource. Both functions create a new window structure and fill it in according to the values specified in the 'WIND' resource.
Note
Window resources must have resource ID numbers greater than 127.
Figure 1-1 illustrates a compiled 'WIND' resource.
Figure 1-1 Structure of a compiled window ('WIND') resource
![]()
A compiled version of a window resource contains the following elements:
- The upper-left and lower-right corners, in global coordinates, of a rectangle that defines the initial size and placement of the window's content region. Your application can change this rectangle before displaying the window, either programmatically or through an optional positioning code described later in this section.
- The window definition ID. The window definition ID is an integer that contains the resource ID of the window definition function in its upper 12 bits and a variation code in its lower 4 bits ; see Window Definition IDs for a discussion of standard pre-Appearance and Appearance-compliant window definition IDs.
- A specification that determines whether the window will be visible or invisible. This characteristic controls only whether the Window Manager displays the window, not necessarily whether the window can be seen on the screen. (A visible window entirely covered by other windows, for example, is "visible" even though the user cannot see it.) You typically create a new window in an invisible state, build the content area of the window, and then display the completed window.
- A specification that determines whether or not the window will have a close box. The 'WDEF' draws the close box when it draws the window frame. The window type specified in the second field determines whether a window can support a close box; this field determines whether the close box is present.
- A reference constant, which your application can use for whatever data it needs to store. When it builds a new window structure, the Window Manager stores, in the refCon field, whatever value you specify in the fifth element of the window resource. You can also put a place-holder value here and then set the refCon field programmatically with the SetWRefCon function.
- A pascal string that specifies the window title.
- A positioning specification that overrides the window position established by the rectangle in the first field. The existence of this field is optional. The positioning constants are convenient when the user is creating new documents or when you are handling your own dialog boxes and alert boxes. When you are creating a new window to display a previously saved document, however, you should display the new window in the same rectangle as that in which it was previously displayed.
'wctb'
The window color table ('wctb') resource is not recommended with Appearance Manager 1.0 and later. When the Appearance Manager is available and you are using standard windows, all information in the window color table resource is ignored except the part identifier constant wContentColor in the value field of the ColorSpec structure. This constant produces the background color for the window's content region.
If your are creating your own custom window definition functions, the window color table resource can still be used.
'WDEF'
The window definition ( 'WDEF') resource is changed with Appearance Manager 1.0 to support the window definition message constants kWindowMsgGetFeatures and kWindowMsgGetRegion.
The window definition resource is the executable code for your window definition function. Provide as the resource data the compiled or assembled code of your window definition procedure. The entry point of your procedure must be at the beginning of the resource data.
See MyWindowDefProc for more information about creating a window definition function.
WARNING
All resources of type 'WDEF' should be nonpurgeable, to ensure that the resource is always loaded. If the resource is not available when the Window Manager needs to load it, a crash will occur.
© 1998 Apple Computer, Inc. - (Last Updated 19 Nov 98)