Re: Newbie: Getting an NSWindow and setting its delegate
Re: Newbie: Getting an NSWindow and setting its delegate
- Subject: Re: Newbie: Getting an NSWindow and setting its delegate
- From: Michael Ströck <email@hidden>
- Date: Sat, 30 Jul 2005 17:52:23 +0200
Well, functionally, obviously not. But the challenge is "Create a new
Application with one window. Create an object that is a delegate of
the window. As the user resizes the window, make sure .....".
Again, I'm new to this too, but I think you skipped the "create an
object" part.
Am 30.07.2005 um 17:40 schrieb Martin Linklater:
Cool. Although I got it working with a lot less code than your
example. I'm not sure if I've done something horrendous but my
solution was a bit simper.
- Create simple Cocoa project in XCode.
- Double click the NIB - CTRL-drag from the Window instance to the
AppController instance - connect the delegator.
Then simply add this function declaration and definition to
AppController.h /.m respectively:
*** add to AppController.h
- (NSSize)windowWillResize:(NSWindow *)sender
toSize:(NSSize)frameSize;
*** add to AppController.m
- (NSSize)windowWillResize:(NSWindow *)sender
toSize:(NSSize)frameSize
{
frameSize.width = frameSize.height / 2;
return frameSize;
}
Then when I resize the Window the size is snapped to be twice as
high as it is wide. Am I missing anything important by not
including all the IBOutlet stuff that is present in your code ?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden