• 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: Confirming NSTextField when a button is pressed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Confirming NSTextField when a button is pressed


  • Subject: Re: Confirming NSTextField when a button is pressed
  • From: Fritz Anderson <email@hidden>
  • Date: Mon, 15 Nov 2004 14:47:38 -0600

What you are seeing is the specified behavior of NSTextField -- it doesn't acquire a new value until it has been finalized by an end-editing key or by something else becoming first responder.

The generic way to fix this is to send makeFirstResponder: nil to your window in the action method for your button.

If you are using controller bindings, the other way to do it is to send commitEditing to the NSController in the action method.

	-- F

On 11 Nov 2004, at 5:16 PM, Andrew White wrote:

Behaviour:

(1) Edit text field, hit return to confirm.

Edited text stays.  controlTextDidEndEditing fires.

(2) Edit text field, click button.

Edited text replaced by prior text. controlTextDidEndEditing does not fire. Button routine fires, but operates on wrong data since text field value not correct.

What it looks like to me is that the temporary text view used for editing is not getting flushed back to the text field when I click the button. Why wouldn't that happen? Is this the correct behaviour?

_______________________________________________ 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: 
 >Confirming NSTextField when a button is pressed (From: Andrew White <email@hidden>)
 >Re: Confirming NSTextField when a button is pressed (From: Daniel Todd Currie <email@hidden>)
 >Re: Confirming NSTextField when a button is pressed (From: Andrew White <email@hidden>)

  • Prev by Date: Focus ring changed
  • Next by Date: RE: NSFontManager and convertFont
  • Previous by thread: Re: Confirming NSTextField when a button is pressed
  • Next by thread: NSView & border
  • Index(es):
    • Date
    • Thread