Important: The information in this document is obsolete and should not be used for new development.
GrowWindow
Use theGrowWindow
function to allow the user to change the size of a window. TheGrowWindow
function displays an outline (grow image) of the window as the user moves the cursor to make the window larger or smaller; it handles all user interaction until the user releases the mouse button. After callingGrowWindow
, you call theSizeWindow
procedure to change the size of the window.
FUNCTION GrowWindow (theWindow: WindowPtr; startPt: Point; sizeRect: Rect): LongInt;
- theWindow
- A pointer to the window record of the window to drag.
- startPt
- The location of the cursor at the time the mouse button was first pressed, in global coordinates. Your application retrieves this point from the
where
field of the event record.- sizeRect
- The limits on the vertical and horizontal measurements of the port rectangle, in pixels.
- Although the
sizeRect
parameter is in the form of theRect
data
type, the four numbers in the structure represent lengths, not
screen coordinates. Thetop
,left
,bottom
, andright
fields of thesizeRect
parameter specify the minimum vertical measurement
(top
), the minimum horizontal measurement (left
), the maximum vertical measurement (bottom
), and the maximum horizontal measurement (right
).- The minimum measurements must be large enough to allow a manageable rectangle; 64 pixels on a side is typical. Because the user cannot ordinarily move the cursor off the screen, you can safely set
the upper bounds to the largest possible length (65,535 pixels) when you're usingGrowWindow
to follow cursor movements.DESCRIPTION
TheGrowWindow
function moves a dotted-line image of the window's right and lower edges around the screen, following the movements of the cursor until the mouse button is released. It returns the new dimensions, in pixels, of the resulting window: the height in the high-order word of the returned long-integer value and the width in the low-order word. You can use the functionsHiWord
andLoWord
to retrieve only the high-order and low-order words, respectively.A return value of 0 means that the new size is the same as the size of the current
port rectangle.ASSEMBLY-LANGUAGE INFORMATION
You can set the global variableDragHook to point to an optional procedure, defined by your application, which will be called by GrowWindow
as long as the mouse button is held down. (If there's anactionProc
procedure, theactionProc
procedure is called first.) Note that the use of the Window Manager's global variables is not guaranteed to be compatible with system software versions later than System 6.SEE ALSO
See Listing 4-13 on page 4-58 for an example that callsGrowWindow
when the user presses the mouse button while the cursor is in the size box.