Activates a windowint sm_wselect(int window_number);int sm_n_wselect(char *window_name);
- Specifies the window to activate, where
window_numberis 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_wselectchanges the number of the specified window and all windows previously above it.
- The window's screen name.
sm_wselectlets 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_wselectinvolves more work inasmuch as you must keep track of the inactive window's position on the stack. However,
sm_wselectcan find windows displayed with
sm_d_windowor related functions, which do not record the screen name.
In character mode,
sm_wselectselects 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_n_wselectcan be used in the following ways:
- Select a hidden screen, update it with
sm_putfield, then deselect it with
sm_wdeselect. Panther updates the visible portion of the hidden screen with the new data. Because of delayed write, Panther updates the screen only when keyboard input is sought.
- Select a hidden screen and open the keyboard. In this case, the selected screen becomes visible, and can hide part or all of the previously active screen. This lets you implement multi-page forms, or switch among several tiled windows. You can let the user select among windows by defining them as siblings.