|
|
Smooth resizing - Snippet
I got this from the Applescript Studio mailing list:
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}But there was no indication of the content of the Application.h file. Any help on this would be greatly appreciated. ---
Smooth resizing - Snippet (correction)
Sorry, the code should be clearer like this:
Smooth resizing - Sorted
OK, I got it working (with a little help from my friends!)
RE: Smooth resizing - Snippet (correction)
How do you get this to work with a toolbar? For me it changes the window's size including the toolbar. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.24 seconds |
|