mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-10 10:42:19 +00:00
Merge pull request #2176 from Dogild/CPView-addSubview
Fixed: Methods viewDidMoveToSuperview viewDidMoveToWindow viewWillMoveToSuperview viewWillMoveToWindow not called as in Cocoa
This commit is contained in:
commit
71bfe4dd44
10 files changed
+498
-52
No files matched your search
+20
-2
@@ -473,8 +473,6 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
|
||||
if (!_sortDescriptors)
|
||||
_sortDescriptors = [];
|
||||
|
||||
[self _startObservingFirstResponder];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -4456,6 +4454,8 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
*/
|
||||
- (void)viewWillMoveToSuperview:(CPView)aView
|
||||
{
|
||||
[super viewWillMoveToSuperview:aView];
|
||||
|
||||
var superview = [self superview],
|
||||
defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
@@ -5128,6 +5128,24 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
return hit;
|
||||
}
|
||||
|
||||
- (void)_removeObservers
|
||||
{
|
||||
if (!_isObserving)
|
||||
return;
|
||||
|
||||
[super _removeObservers];
|
||||
[self _stopObservingFirstResponder];
|
||||
}
|
||||
|
||||
- (void)_addObservers
|
||||
{
|
||||
if (_isObserving)
|
||||
return;
|
||||
|
||||
[super _addObservers];
|
||||
[self _startObservingFirstResponder];
|
||||
}
|
||||
|
||||
- (void)_startObservingFirstResponder
|
||||
{
|
||||
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(_firstResponderDidChange:) name:_CPWindowDidChangeFirstResponderNotification object:[self window]];
|
||||
|
||||
Reference in new issue
Block a user