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

  • Prev by Date: Re: Copying NSTextField stringValue on click
  • Next by Date: Deactivating Windows for Modal Event Loop
  • Previous by thread: Re: Copying NSTextField stringValue on click
  • Next by thread: Deactivating Windows for Modal Event Loop
  • Index(es):
    • Date
    • Thread