[Top][All Lists]

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

Re: NSTextField questions

From: David Ayers
Subject: Re: NSTextField questions
Date: Mon, 16 Sep 2002 22:36:27 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

David Ayers wrote:

Dirk Lattermann wrote:

The delegate of the NSTextField doesn't get a
controlTextDidBeginEditing: message. It works with
controlTextDidChange: and ...EndEditing.
In fact, I think NSTextField itself doesn't receive
textDidBeginEditing, which I found out when subclassing NSTextField.

Sorry for answering so late, but I hardly had time to actually do some debugging here. Thus far it seems that the BEGAN_EDITING macro in NSTextView's shouldChangeTextInRange:replacementString: doesn't return YES when the actual editing begins. This is the method that is supposed to post the notifcation. I'll try to continue to find out what's going on.

This might take a while. It seems that the shouldChangeTextInRange:replacementString: gets invoked (multiple times) during the current mechanism of the NSTextField becoming firstResponder even before the NSTextView's delegate (the NSTextField) is setup! Therefore the flag in the layout manager is already set and the NSTextDidBeginEditingNofication is posted before the NSTextView has a delegate (it's current NSTextView) which should (and would) in turn post the NSControlTextDidBeginEditing. Once the delagte is set, further editing (ie. invocations of shouldChangeTextInRange:) test the layout manger's flag with the BEGAN_EDITING macro. Since this returns YES now, the NSTextDidChangeNotification isn't posted anymore.

I might look into this a bit more later on, but I think it would be wiser to wait for the firstResponder mechanism to be fixed, before taking on this bug.

Sorry if couldn't help you right now,


reply via email to

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