views:

38

answers:

2

it's possible to get window width or height while resizing it? not on start or end of resizing (viewWillStartLiveResize, viewDidEndLiveResize), but in real time?

A: 

If your window's content view resizes with the window, and you're willing to make that view a custom NSView subclass, then you can override -[NSView resizeSubviewsWithOldSize:] and check self.bounds there.

Tom
A: 

Yes. Set an object as the window's delegate and implement either of these delegate methods:

- (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize;
- (void)windowDidResize:(NSNotification *)notification;

The -windowDidResize: method is sufficient if you want to keep some other window synchronized to the size of your window as it is called with every small size change, not at the end of the resize operation.

Rob Keniger