Programming Guide



sm_*wselect

Activates a window

int sm_wselect(int window_number);
int sm_n_wselect(char *window_name);

window_number
Specifies the window to activate, where window_number is its zero-based offset in the window stack. Windows are numbered sequentially from the bottom of the stack, where the bottom-most screen, or base window, is 0. Calling sm_wselect changes the number of the specified window and all windows previously above it.

window_name
The window's screen name.

Returns

Description

sm_wselect lets you change the active window in a multi-window display. This function is typically used in routines that update information in windows that might be inactive.

Only one window—the one at the top of the window stack—can be active at a time, and thereby accessible to library functions and user input. These functions activate a window by bringing it to the top of the window stack and restores the cursor to its last position in it. If the window is hidden by an overlying window, Panther brings it to the forefront of the display.

You can specify a window by its offset into the window stack with sm_wselect, or by its screen name with sm_n_wselect. sm_wselect involves more work inasmuch as you must keep track of the inactive window's position on the stack. However, sm_wselect can find windows displayed with sm_d_window or related functions, which do not record the screen name.

In character mode, sm_wselect selects sibling windows as a group. If any one of a set of sibling windows is activated by this function, then all of the siblings are brought to the top of the window stack. The selected window becomes the active window at the top of this set. Otherwise, the sequence within the set of siblings remains the same.

sm_wselect and sm_n_wselect can be used in the following ways:

See Also

sm_wcount, sm_wdeselect