Up   Previous   Next  

Changing the Window Size

Your application must handle changing the window size for all windows that have a size region. In order to change the window size, the text object in the window cannot be a subframe of the window.

When your application receives a mouse-down event in the size box of an active window that belongs to your application, you can call the TXNGrowWindow function to track the cursor and change the size of the text object's view rectangle.

Listing 3-12 shows a MyDoGrowWindow function that handles a mouse-down event in the size box of an active window. You should call this function only for a text object whose frame (view rectangle) occupies the entire window.

Listing 3-12 Changing the size of a window
void MyDoGrowWindow (WindowPtr theWindow, EventRecord *event) { TXNObject textObject = NULL; // Call your own function to get the text object. MyGetTextObject (theWindow, &textObject); // Call the MLTE function to change the size of the window. TXNGrowWindow (textObject, event); }

Copyright © 2001 Apple Computer, Inc. (Last Updated January 11, 2001)

Up   Previous   Next