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: Macintosh Toolbox Essentials /
Chapter 4 - Window Manager / Introduction to Windows


Windows on the Desktop

Multiple windows, from different applications, can appear simultaneously on the desktop. The Window Manager tracks all windows, using its own private data structure called the window list. Entries appear in the window list in their order on the desktop, beginning with the frontmost, active window. When the user changes the ordering of windows on the desktop, the Window Manager generates events telling your application to activate, deactivate, and redraw windows as necessary. The Window Manager prevents you from drawing accidentally in the windows of other applications.

The user can interact with only one application at a time. The application with which the user is interacting (that is, the application that owns the window in which the user is working) is the active application, or foreground process, and the others are inactive applications, or background processes. One way the user can switch applications is by clicking in a window that belongs to a background process. The Process Manager then generates events telling the previously active application that it's about to be suspended and telling the newly active application that it can resume processing. (For more infor- mation about the workings of foreground and background processes and about the events that support simultaneous running of multiple applications, see the chapter "Event Manager" in this book.)

Your application is likely to have multiple windows on the desktop at once: one or more document windows, possibly one or more dialog box windows, and possibly some other special-purpose windows. The section "Managing Multiple Windows" beginning on page 4-20 suggests a technique for keeping track of multiple windows.

On the original Macintosh computer, the desktop area was limited to a single screen of known dimensions. Contemporary systems, however, can support multiple monitors of various sizes and capabilities. To place its windows in the appropriate place on the desktop, your application must pay attention to what screen space is available and where the user is working. For the rules governing window placement, see Macintosh Human Interface Guidelines. For techniques for managing windows on multiple screens, see "Positioning a Document Window on the Desktop" beginning on page 4-27.

The entire area of the desktop--that is, the screen area that is not occupied by the menu bar--is known as the gray region. The Window Manager maintains a pointer to the gray region in a global variable named GrayRgn; you can retrieve a pointer to the gray region with the Window Manager function GetGrayRgn.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996