GrowWindow
long GrowWindow( theWindow, startPoint, sizeRect ); Point startPoint ; position of a mouseDown (global coordinates) Rect *sizeRect ; minimum and maximum size returns hiword=new height; loword=new width
GrowWindow draws a "grow image" of the window and tracks the mouse as the user changes the window's size. It sets limits for the operation and
returns the new size. It does not redraw the window.
theWindow identifies the window being resized. It is normally a WindowPtr startPoint is a Point, in global coordinates. It is normally the where field of an EventRecord that indicated a mouseDown event in the grow region (size box) of the window.
sizeRect is the address of an 8-byte Rect structure. It identifies the limits within which the user will be allowed to size the window. Each field
of the structure specifies a size in pixels, defined as:
sizeRect.top minimum height of the window
sizeRect.bottom maximum height of the window
sizeRect.left minimum width of the window
sizeRect.right maximum width of the window
Returns: a long integer identifying the new size - as outlined by the grow image - when the mouse is released. A return value of 0 indicates no
change. Otherwise, the long is defined as two 16-bit words as
follows:
high word indicates the new height of the window
low word indicates the new width
Notes: As with DragWindow, this function tracks the mouse while drawing an outline image of the window. However, this function does not redraw the
screen in its new size (use SizeWindow to redraw the screen). Typical usage for a document window involves the following steps:
GrowWindow let the user select new size (returns non-zero) SizeWindow to height & width returned from GrowWindow . . . reflow text, etc.
The global variable screenBits (a BitMap structure) may help you decide what values to use in sizeRect :
screenBits.bounds.right is the maximum width of the screen
screenBits.bounds.bottom is the maximum height of the screen
The Toolbox utility functions LoWord and HiWord are handy for breaking