Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Smooth Resizing (again)



Here's a post from the archives:
http://lists.apple.com/archives/applescript-studio/2002/Dec/21/ changingwindowsize.001.txt

Anybody out there willing to explain to a Cocoa newbie how I get the following to work in an AS Studio application?
Or if you've got the original demo project "Smooth Resize" from Jan Van Boghout to share...
Please...

[quote]
Okay...put the following lines in your
main.m file

// Thanks to Jan Van Boghout for this code, from his demo app
"SmoothResize"

#import "Application.h"

@implementation NSApplication (ApplicationName)

- (void)resizeWindow :(NSWindow *)window toHeight :(int)height toWidth
:(int)width
{
NSRect windowFrame,newWindowFrame;
windowFrame = [NSWindow contentRectForFrameRect:[window frame]
styleMask:[window styleMask]];
newWindowFrame = [NSWindow
frameRectForContentRect:NSMakeRect(NSMinX(windowFrame),NSMaxY(windowFram
e) - height,width,height) styleMask:[window styleMask]];

[window setFrame:newWindowFrame display:YES animate:YES];
}

@end

Next, to call on this, use the following syntax:

call method "resizeWindow:toHeight:toWidth:" with parameters {window
"theWindow", Y, X}
[/quote]

--
autoMAC-it
mailto:email@hidden
visit: http://www.dizzypenguin.com/automac-it/
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.