Hi.
I'm just playing around with OSX app dev. I'm totally noob.
I thought it is straight forward like iOS app dev. But after a few days
of going at this, it seems it is not that easy.
Here's what I'm trying to do. I have a NSWindow. In it I put an Image Well (wth with the naming? lol)
Well, it is an NSImageView (no pun intended).
So I just want the NSImageView frame to resize following the NSWindow size. It's that simple.
Here's what I did that is NOT working:
NSImageView as imageView.
write the delegate method of NSWindow windowDidResize and just resize the framesize
of imageView in it.
This delegate is called (tested with that NSLog).
However the NSImageView just stays there with the original size.
I checked the IBOutlet connection is ok.
What gives? Why won't the NSImageView resize?
I'm just playing around with OSX app dev. I'm totally noob.
I thought it is straight forward like iOS app dev. But after a few days
of going at this, it seems it is not that easy.
Here's what I'm trying to do. I have a NSWindow. In it I put an Image Well (wth with the naming? lol)
Well, it is an NSImageView (no pun intended).
So I just want the NSImageView frame to resize following the NSWindow size. It's that simple.
Here's what I did that is NOT working:
NSImageView as imageView.
write the delegate method of NSWindow windowDidResize and just resize the framesize
of imageView in it.
Code:
- (void)windowDidResize:(NSNotification *)notification {
// NSLog(@"resized");
NSRect zWindowRect = [[self window]frame];
NSRect zContentRect = [[self window]contentRectForFrameRect:zWindowRect];
[self.imageView setFrameSize:NSMakeSize(zContentRect.size.width,
zContentRect.size.height)];
[self.imageView setNeedsDisplay:YES];
}
However the NSImageView just stays there with the original size.
I checked the IBOutlet connection is ok.
What gives? Why won't the NSImageView resize?