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 / About the Window Manager


Events in Windows

Events are messages that describe user actions and report on the processing status of your application. The Window Manager generates two kinds of events: activate
events and update events.
Activate events tell your application that a specified
window is becoming active or inactive. Update events tell your application that it
must redraw part or all of a window's content region. The section "Handling Events in Windows" beginning on page 4-36 describes when these events occur and how your application responds.

One of the basic functions of the Window Manager is to report where the cursor is
when your application receives a mouse-down event. The Window Manager function FindWindow tells your application whether the cursor is in a window and, if it's in
a window, which window it's in and where in that window (that is, the title bar, the
drag region, and so on). You can use the FindWindow function as a first filter for mouse-down events, separating events that merely affect the window display from events that manipulate user data.

The Window Manager also provides a set of routines that help you implement the standard window-manipulation conventions:
User actionApplication response
Dragging the title barMoves the window
Dragging the size boxResizes the window
Clicking the zoom boxToggles the window between two sizes and locations, known as the user state and the standard state
Clicking the close boxCloses the window

The next section, "Using the Window Manager," describes how you can use the Window Manager to move, resize, zoom, and close windows.

You can call the Control Manager to handle events in window controls, as described in the chapter "Control Manager" in this book. If you use the Dialog Manager for your alert boxes and modal dialog boxes, the Dialog Manager handles keyboard activity and mouse events in these windows. You can also use the Dialog Manager to handle keyboard activity and mouse events in the content region of movable modal dialog boxes and modeless dialog boxes. Your application, however, must handle mouse events in the title bar and close box of a movable modal or modeless dialog box.

When your application is active, a mouse-down event in a window belonging to any other application, including the Finder, switches your application to the background (unless there's an alert box or a modal dialog box pending, in which case the Dialog Manager merely sounds the system alert).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996