Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Faster window resize in Carbon

Faster window resize in Carbon
Thread Tools
Junior Member
Join Date: Apr 2001
Location: Sunnyvale, CA
Status: Offline
Reply With Quote
May 15, 2001, 12:14 PM
 
I don't know if this is a well known hack, but I've found a work around that speeds up window resizing in Carbon apps. I used this hack in one of my apps, and window resizing is as fast as in any Cocoa app (if not faster)... before, it was so slow that I thought it wasn't working (which is why I came up with the hack in the first place).

The culpit behind slow window resizing is the GrowWindow() function.

The solution is to simply write your own GrowWindow() function, that may look something like this:

void myGrowWindow( WindowRef window){
Point pt;
int h,w;

SelectWindow(window);
while (Button()){
GetMouse(&pt);
h=pt.v; // calculate new height
w=pt.h; // calculate new width
SizeWindow(window,w,h,true);
UpdateWindowContents( window ); //redraw contents
}
}

AFAIK the above function (or something similar to it) works identical to GrowWindow, except much faster. I haven't tried this in OS 9 (my app is OS X only) but it should work, and might even give you live window resizing...

It's a simple work around, and I'm sure other people have thought of it. But if you haven't, well, now you know.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:34 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2