Changing the Size and Location of a Window

Designer: You can change the size and location of a window with the Designer. You can also change the size and location in your code, by calling wn_mod() as discussed below.

Code: You can change the size and location of a window that has already been defined with the window modify function, wn_mod():

wn_mod(rb, cb, row_q, col_q, wnp)
 
int rb;
/* Beginning row of window 
*/
int cb;
/* Beginning column of window
*/
int row_q;
/* Number rows to make window
*/
int col_q;
/* Number columns to make window
*/
WINDOWPTR wnp;
/* Pointer to window to modify 
*/

You can call wn_mod() whether the window is on the screen or not. If you call wn_mod() when the window is not displayed, the values of the window origin and size are changed in the window structure. When you display the window with a call to wn_up(), the window will have the size and location specified in the call.

If you call wn_mod() when the window is already on the screen, the values of the window origin and size are changed in the window structure, and the window is immediately redisplayed using the new values for the size and location.

Caution: Modifying the size of a window changes the size of the window's interior work area. For virtual windows, this is not a problem, since Vermont Views assumes that the work area and the memory screen buffer are not the same size. For basic windows, however, this can cause problems. For a complete description of possible problems and their solutions, see the section "Resizing a Memory Screen," later in this chapter.


Home Contents Previous Next