[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSComboBox delegate
From: |
Quentin Mathé |
Subject: |
Re: NSComboBox delegate |
Date: |
Thu, 2 Feb 2006 19:32:21 +0100 |
Le 1 févr. 06 à 19:10, Andreas Höschler a écrit :
Hi all,
I want to be notified when I leave a combobox with tab after
entering a few charatcers. setCompletes is set to YES. I implemented
- (void)comboBoxWillDismiss:(NSNotification *)notification
{
NSLog(@"comboBoxWillDismiss");
}
For this one, I don't know, NSComboBoxCell code seems ok. I have to
take a more in depth look at it.
- (void)textDidEndEditing:(NSNotification *)aNotification
{
NSLog(@"textDidEndEditing");
}
- (void)textDidChange:(NSNotification *)aNotification
{
NSLog(@"textDidChange");
}
in the delegate but none of these is ever called. Any ideas?
For these ones, it is the expected behavior I think.
textDidChange: or textDidEndEditing: are delegate methods specific to
NSText/NSTextView, but not part of NSControl.
NSTextField is in fact NSComboBox superclass and NSControl is
NSTextField superclass.
At first sight, it may seem that NSTextField sends such
textDidChange: method to its delegate because it implements this
method. In fact NSTextField is the field editor delegate, that's why
it implements these NSTextView delegate methods.
Here are NSTextView notifications :
- textShouldBeginEditing:
- textDidBeginEditing:
- textDidChange:
- textShouldEndEditing:
- textDidEndEditing:
They are received by NSTextField/NSComboBox, but propagated to their
own delegate in form of NSControl notifications.
So you have to rely on NSControl notifications which are :
- control:textShouldBeginEditing:
- control:textShouldEndEditing:
- controlTextDidBeginEditing:
- controlTextDidChange:
- controlTextDidEndEditing:
I hope I haven't made wrong statements :-)
Let me know whether it works better this way or not.
Quentin.
--
Quentin Mathé
qmathe@club-internet.fr