Re: controlTextDidChange, backspace possible?
Re: controlTextDidChange, backspace possible?
- Subject: Re: controlTextDidChange, backspace possible?
- From: j o a r <email@hidden>
- Date: Tue, 14 Sep 2004 20:08:52 +0200
On 2004-09-14, at 19.40, Harilaos Skiadas wrote:
My problem I think was in my bad design, where I had
the subclass of the text field call the method to send
the command across, and then for handling this whole
list of commands, I had my program type each one of
them in the text field and then call the text field's
sendCommand method, which I am starting to realize was
probably a terrible mistake.
When I subclass one of the standard Cocoa classes (at least the ones
not especially designed for subclassing, like NSObject,
NSWindowController, et.c.) I always try to only add the absolutely
minimum of functionality to the subclass, and then delegate the rest to
one of my general controller objects.
The problem arose in the
following situation: When my text field had focus and
I moved to the other window to start the drag, it
seems that the field editor remained attached to the
field, and hence when I tried to drag and drop, the
field editor would try to handle it and my subclass's
performDragOperation would never be called (even
though my subclass's draggingEntered and
draggingExited where).
I posted this a couple days ago under "Text Views,
Text Fields and dragging", but I didn't get any
responses.
Why do you need to override the built in drag-n-drop functionality?
Does it not suffice to monitor the NSControlTextDidChangeNotifications?
If you do need to override, have you considered creating a custom field
editor for that purpose?
Note: The text system is probably the most complicated piece of Cocoa.
I would advice against spending too much time on bending it to your
needs, especially as you're new to Cocoa. Get your basic functionality
up and running, and worry about the details later.
I feel this behavior is a bit buggy. Shouldn't the
field editor detach itself from the text field when
the window loses key status, not only when the field
loses focus?
Why? The text field is still in "edit mode" even if it is not first
responder.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden