Re: Copying NSTextField stringValue on click
Re: Copying NSTextField stringValue on click
- Subject: Re: Copying NSTextField stringValue on click
- From: Philip Dow <email@hidden>
- Date: Tue, 27 Dec 2005 22:15:05 +0100
Hi Jon,
Target-Action behavior does not respond to a click in the text field.
Rather, it will fire when the user presses the return button or when
the text field loses focus. What you're experiencing is the first
text field losing focus when you click on the second field and thus
firing its action to the target.
If the text fields are already not editable, then I don't see a
terrible problem overriding mouse down in your subclass and having it
call appropriate target's desired method. There may be an easier way
to do it, but you should definitely be able to grab the text field's
cell and through that the target and action selector.
-Phil
On Dec 27, 2005, at 10:04 PM, Jon Flowers wrote:
Trying to get the value of a non editable NSTextField when the user
clicks on the field. Actually need this functionality on 4 fields.
I have tried to set the target action and that doesn't work on the
first textfield clicked only when the second textfield is clicked
and then it responds with the previously clicked fields string
value. Have searched but can't find what I am looking for.
Subclassing is a possible solution if I knew which method to
override, wondering if mouseDown would be a good idea?
Any help would be greatly appreciated.
_______________________________________________
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
_______________________________________________
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