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 / Window Manager Reference
Window Manager Routines / Displaying Windows


SelectWindow

Use the SelectWindow procedure to make a window active. The SelectWindow procedure changes the active status of a window but does not affect its visibility.

PROCEDURE SelectWindow (theWindow: WindowPtr);
theWindow
A pointer to the window's window record.
DESCRIPTION
The SelectWindow procedure removes highlighting from the previously active window, brings the specified window to the front, highlights it, and generates the activate events to deactivate the previously active window and activate the specified window. If the specified window is already active, SelectWindow has no effect.

Even if the specified window is invisible, SelectWindow brings the window to the front, activates the window, and deactivates the previously active window. Note that in this case, no active window is visible on the screen. If you do select an invisible window, be sure to call ShowWindow immediately to make the window visible (and accessible to the user).

Call SelectWindow when the user presses the mouse button while the cursor is in the content region of an inactive window.

SEE ALSO
See Listing 4-9 on page 4-44 for an example that calls SelectWindow to change
the active window when the user presses the mouse button while the cursor is
in an inactive window.

See Listing 4-18 on page 4-64 for an example that uses SelectWindow and ShowWindow together to restore a window's active, visible status after it has
been made invisible with HideWindow.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996