[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

movewindow(), sizewindow(), windowtofront() and windowtoback() allow the
program to modify the size and placement of its windows.  These calls are
available in all versions of the operating system.

movewindowinfrontof(), changewindowbox() and zipwindow() have been added
in Release 2 to provide more flexible control over the size and placement
of windows.

All of these functions are asynchronous.  The window will not be affected
by them immediately, rather, Intuition will act on the request the next
time it receives an input event.  Currently this happens at a minimum rate
of ten times per second, and a maximum of sixty times per second.  There
is no guarantee that the operation has taken place when the function
returns.  In some cases, there are IDCMP messages which will inform the
application when the change has completed (for example, an idcmp_newsize
event indicates that a resize operation has completed).

Use the movewindow() function to move a window to a new position in the
screen.  Use sizewindow() to change the size of the window:

    void MoveWindow( struct Window *window, long dx, long dy );
    void SizeWindow( struct Window *window, long dx, long dy );

Note that both movewindow() and sizewindow() take the amount of change in
each axis (delta values instead of absolute coordinates).  To specify the
coordinates as absolute numbers, use changewindowbox().  the sizewindow()
function will respect the window's maximum and minimum dimensions only if
the window has a sizing gadget.

A new function in Release 2, changewindowbox(), allows an application to
change the window size and position in a single call:

    void ChangeWindowBox( struct Window *window, long left, long top,
                          long width, long height );

Note that the position and size values are absolutes and not deltas.  The
window's maximum and minimum dimensions are always respected.

To depth arrange windows under program control, use windowtofront() and
windowtoback():

    void WindowToFront( struct Window *window );
    void WindowToBack( struct Window *window );

windowtofront() depth arranges a given window in front of all other
windows on its screen.  windowtoback() depth arranges a given window
behind all other windows on its screen.

To move a window in front of a specific, given window (as opposed to all
windows), use movewindowinfrontof():

    void MoveWindowInFrontOf( struct Window *window,
                              struct Window *behindWindow );

movewindowinfrontof() is a new call provided in release 2 and is not
available in older versions of the OS.

To toggle the window size between its two zoom settings use zipwindow().
This performs the same action that occurs when the user selects the zoom
gadget:

    void ZipWindow( struct Window *window );

The two zoom settings are the initial size and position of the window when
it was first opened and the alternate position specified with the wa_zoom
tag.  If no WA_Zoom tag is provided, the alternate position is taken from
the window's minimum dimensions, unless the window was opened at its
minimum dimension.  In that case, the alternate position is taken from the
window's maximum dimension.  zipwindow() is a new call provided in release
2 and is not available in older versions of the OS.