Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Smooth resizing - Snippet (correction)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Smooth resizing - Snippet (correction)
Authored by: DizzyPenguin on Aug 10, '03 02:19:50PM

Sorry, the code should be clearer like this:

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}

---
DizzyPenguin



[ Reply to This | # ]
Smooth resizing - Sorted
Authored by: DizzyPenguin on Aug 12, '03 05:52:39AM

OK, I got it working (with a little help from my friends!)

---
DizzyPenguin



[ Reply to This | # ]
RE: Smooth resizing - Snippet (correction)
Authored by: samsprograms on Aug 12, '03 04:50:57PM

How do you get this to work with a toolbar? For me it changes the window's size including the toolbar.



[ Reply to This | # ]