Corrected delegate setup

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3731 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-02-17 09:13:43 +00:00
parent a2f42a39e9
commit cf7a747a7d
5 changed files with 92 additions and 33 deletions

View file

@ -354,4 +354,21 @@ if(container) [self setTextContainer: container];
{
}
- (void) setDelegate: (id) anObject
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[super setDelegate: anObject];
#define SET_DELEGATE_NOTIFICATION(notif_name) \
if ([delegate respondsToSelector: @selector(textView##notif_name:)]) \
[nc addObserver: delegate \
selector: @selector(textView##notif_name:) \
name: NSTextView##notif_name##Notification \
object: self]
SET_DELEGATE_NOTIFICATION(DidChangeSelection);
SET_DELEGATE_NOTIFICATION(WillChangeNotifyingTextView);
}
@end