Re: Copying NSTextField stringValue on click
Re: Copying NSTextField stringValue on click
- Subject: Re: Copying NSTextField stringValue on click
- From: Jeff LaMarche <email@hidden>
- Date: Tue, 27 Dec 2005 16:15:36 -0500
On Dec 27, 2005, at 4: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?
I take it that merely making text item selectable is not going to
meet your needs?
I dunno if this would be a "sanctioned" way of doing it, but if you
used a small square button and turned off the "bordered" attribute in
the inspector and set the behavior to "Momentary Change" so it
doesn't highlight when it's clicked. That wold give you a button but
it would look like just text and would function as you expect.
The default behavior of a text field is to send its action when it
yields first responder status, not just when you click on them, which
is why you get it the first field's action being called when you
click the second item - the first item is yielding first responder
status and then sends its message.
_______________________________________________
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