• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Copying NSTextField stringValue on click
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Copying NSTextField stringValue on click (From: Jon Flowers <email@hidden>)

  • Prev by Date: Re: Multiple Views in a NSScrollView
  • Next by Date: Re: Copying NSTextField stringValue on click
  • Previous by thread: Copying NSTextField stringValue on click
  • Next by thread: Re: Copying NSTextField stringValue on click
  • Index(es):
    • Date
    • Thread