discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSComboBox delegate


From: Andreas Höschler
Subject: Re: NSComboBox delegate
Date: Sun, 5 Feb 2006 16:14:03 +0100

Hi Quentin,

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.

Yes, it worked with these methods. I was simply too tired to still know what I did. A very interesting observation, while figuring this out was that I found two issues that worked in GNUstep (according to the documentation how I understand it) but did not in MacOSX. This is a very new experience for me. Usually it's the other way around. :-)

E.g. I do

[newVehicleButton setRefusesFirstResponder:NO];
[newDeliveryButton setRefusesFirstResponder:NO];

in order to be able to tab from a textfield to a button so that I can trigger its action with the keyboard (no mouse action required). Whatever I did I was not able to get that working on MacOSX. Moreover when tabbing out of the combo box the method

- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor

on the delegate is not called on MacOSX, but it is called (like it should be) on GNUstep!

Yes!!! :-)

Regards,

Andreas

reply via email to

[Prev in Thread] Current Thread [Next in Thread]