mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:40:47 +00:00
Cached the default notification center everywhere
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7252 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6c10ef9517
commit
1fba96bf07
1 changed files with 14 additions and 20 deletions
|
@ -1304,6 +1304,8 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
|
||||||
|
|
||||||
// begin: NSText------------------------------------------------------------
|
// begin: NSText------------------------------------------------------------
|
||||||
|
|
||||||
|
static NSNotificationCenter *nc;
|
||||||
|
|
||||||
@implementation NSText
|
@implementation NSText
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1317,6 +1319,8 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
|
||||||
|
|
||||||
[self setVersion: 1]; // Initial version
|
[self setVersion: 1]; // Initial version
|
||||||
|
|
||||||
|
nc = [NSNotificationCenter defaultCenter];
|
||||||
|
|
||||||
[self setSelectionWordGranularitySet:
|
[self setSelectionWordGranularitySet:
|
||||||
[NSCharacterSet whitespaceCharacterSet]];
|
[NSCharacterSet whitespaceCharacterSet]];
|
||||||
[self setSelectionParagraphGranularitySet:
|
[self setSelectionParagraphGranularitySet:
|
||||||
|
@ -1609,12 +1613,11 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
|
||||||
[self updateFontPanel];
|
[self updateFontPanel];
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
[[NSNotificationCenter defaultCenter]
|
[nc postNotificationName: NSTextViewDidChangeSelectionNotification
|
||||||
postNotificationName: NSTextViewDidChangeSelectionNotification
|
object: self
|
||||||
object: self
|
userInfo: [NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
userInfo: [NSDictionary dictionaryWithObjectsAndKeys:
|
NSStringFromRange (_selected_range),
|
||||||
NSStringFromRange (_selected_range),
|
NSOldSelectedCharacterRange, nil]];
|
||||||
NSOldSelectedCharacterRange, nil]];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// display
|
// display
|
||||||
|
@ -2207,8 +2210,6 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
|
||||||
|
|
||||||
- (void) setDelegate: (id) anObject
|
- (void) setDelegate: (id) anObject
|
||||||
{
|
{
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
|
||||||
|
|
||||||
if (_delegate)
|
if (_delegate)
|
||||||
[nc removeObserver: _delegate name: nil object: self];
|
[nc removeObserver: _delegate name: nil object: self];
|
||||||
ASSIGN(_delegate, anObject);
|
ASSIGN(_delegate, anObject);
|
||||||
|
@ -2496,9 +2497,7 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
|
||||||
//<!> stop timed entry
|
//<!> stop timed entry
|
||||||
}
|
}
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
[nc postNotificationName: NSTextDidEndEditingNotification object: self];
|
||||||
postNotificationName: NSTextDidEndEditingNotification
|
|
||||||
object: self];
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2521,9 +2520,7 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
|
||||||
// [self unlockFocus];
|
// [self unlockFocus];
|
||||||
// //<!> restart timed entry
|
// //<!> restart timed entry
|
||||||
// }
|
// }
|
||||||
[[NSNotificationCenter defaultCenter]
|
[nc postNotificationName: NSTextDidBeginEditingNotification object: self];
|
||||||
postNotificationName: NSTextDidBeginEditingNotification
|
|
||||||
object: self];
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2777,8 +2774,7 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
|
||||||
|
|
||||||
- (void) didChangeText
|
- (void) didChangeText
|
||||||
{
|
{
|
||||||
[[NSNotificationCenter defaultCenter]
|
[nc postNotificationName: NSTextDidChangeNotification object: self];
|
||||||
postNotificationName: NSTextDidChangeNotification object: self];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// central text inserting method (takes care
|
// central text inserting method (takes care
|
||||||
|
@ -3372,10 +3368,8 @@ other than copy/paste or dragging. */
|
||||||
number = [NSNumber numberWithInt: textMovement];
|
number = [NSNumber numberWithInt: textMovement];
|
||||||
uiDictionary = [NSDictionary dictionaryWithObject: number
|
uiDictionary = [NSDictionary dictionaryWithObject: number
|
||||||
forKey: @"NSTextMovement"];
|
forKey: @"NSTextMovement"];
|
||||||
[[NSNotificationCenter defaultCenter]
|
[nc postNotificationName: NSTextDidEndEditingNotification
|
||||||
postNotificationName: NSTextDidEndEditingNotification
|
object: self userInfo: uiDictionary];
|
||||||
object: self
|
|
||||||
userInfo: uiDictionary];
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue