Carbon


ResizeWindow

Header: MacWindows.h Carbon status: Supported

Handles all user interaction while a window is being resized.

Boolean ResizeWindow (
    WindowRef window, 
    Point startPoint, 
    const Rect *sizeConstraints, 
    Rect *newContentRect
);
window

A pointer to the window to be resized.

startPoint

Set the Point structure to contain the location, specified in global coordinates, where the mouse-down event occurred. Your application may retrieve this value from the where field of the event structure.

sizeConstraints

Set the rectangle to specify the limits on the vertical and horizontal measurements of the content rectangle, in pixels. Although this parameter gives the address of a structure that is in the form of the Rect data type, the four numbers in the structure represent limits, not screen coordinates. The top, left, bottom, and right fields of the structure specify the minimum vertical measurement (top), the minimum horizontal measurement (left), the maximum vertical measurement (bottom), and the maximum horizontal measurement (right). The minimum dimensions should be large enough to allow a manageable rectangle; 64 pixels on a side is typical. The maximum dimensions can be no greater than 32,767. You can pass NULL to allow the user to resize the window to any size that is contained onscreen.

newContentRect

On input, a pointer to a structure of type Rect. On return, the structure contains the new dimensions of the window’s content region, in global coordinates.

function result

true if the window was successfully resized; otherwise, false.

DISCUSSION

The ResizeWindow function moves an outline (grow image) of the window’s edges around the screen, following the user’s cursor movements, and handles all user interaction until the mouse button is released. Unlike with the function GrowWindow, there is no need to follow this call with a call to the function SizeWindow, because once the mouse button is released, ResizeWindow resizes the window if the user has changed the window size. Once the resizing is complete, ResizeWindow draws the window in the new size.

Your application should call the ResizeWindow function instead of the earlier Window Manager functions SizeWindow and GrowWindow. Some appearances may allow the window to be resized from any corner, not just the bottom right, and as a result, when the user resizes the window, the window may move on the screen and not merely change size. ResizeWindow informs your application of the new window bounds, so that your application can respond to any changes in the window’s position.

VERSION NOTES

This function is aupported with Mac OS 8.6 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when WindowsLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by WindowsLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)