mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 14:30:38 +00:00
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:
parent
a2f42a39e9
commit
cf7a747a7d
5 changed files with 92 additions and 33 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue