Challenge: Make a Delegate


[code]- (NSSize)windowWillResize:(NSWindow *)sender

NSSize mySize = NSMakeSize(2*frameSize.height, frameSize.height);

NSLog(@"window size is now %f and %f", frameSize.width, frameSize.height);
return mySize;


Height is not exactly half of width as seen in the log. It is near about half.


Perhaps this is beyond the scope of the challenge: I’m curious about the behavior when the “maximize button” in the caption bar is clicked. I see the delegate called then, but the return value seems to be ignored: the window goes full screen.

Is there someway to make the maximize behavior still have h = 2 * w (which I’ll conceded isn’t really maximized)?

BTW, I think you want: