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

#import "Application.h"

@implementation NSApplication (ApplicationName)

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

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


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

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


[ 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!)


[ 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 | # ]