New methods on NSView with code from viewWillMoveToWindow: and

viewWillMoveToSuperview:. The later are now empty to allow 
subclasses not to call the super implementation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26053 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-02-11 11:37:29 +00:00
parent 5efc693137
commit 3ac0da9c43
3 changed files with 90 additions and 66 deletions

View file

@ -101,6 +101,11 @@ BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
- (void) postDragEvent: (NSEvent*)event;
@end
@interface NSView (MoveToWindow)
// Normally this method is only used internally.
- (void) _viewWillMoveToWindow: (NSWindow*)newWindow;
@end
/*
* Category for internal methods (for use only within the NSWindow class itself
* or with other AppKit classes.
@ -731,7 +736,7 @@ many times.
}
/* Clean references to this window - important if some of the views
are not deallocated now */
[_wv viewWillMoveToWindow: nil];
[_wv _viewWillMoveToWindow: nil];
/* NB: releasing the window view does not necessarily result in the
deallocation of the window's views ! - some of them might be
retained for some other reason by the programmer or by other
@ -951,7 +956,7 @@ many times.
cframe.size = _frame.size;
_wv = [windowDecorator newWindowDecorationViewWithFrame: cframe
window: self];
[_wv viewWillMoveToWindow: self];
[_wv _viewWillMoveToWindow: self];
/* Create the content view */
cframe.origin = NSZeroPoint;