• 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: How to force validation of a NSTextField?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to force validation of a NSTextField?


  • Subject: Re: How to force validation of a NSTextField?
  • From: Bill Cheeseman <email@hidden>
  • Date: Sat, 16 Mar 2002 16:01:56 -0500

on 02-03-16 3:04 PM, Thomas Lachand-Robert at email@hidden wrote:

> I have an app with several TextFields,
> and a "Run" button. Clicking the latter should validate whichever text
> field is currently edited (if any) and then do domething.

The standard way to do this is to make the window first responder. Something
like this:

[[self window] makeFirstResponder:[self window]];

Making the window first responder makes whoever is currently first responder
resign, which forces validation. You don't have to know who is first
responder to do this. Leaving the window as first responder afterwards is
harmless.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont - http://members.valley.net/croquetvermont
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How to force validation of a NSTextField?
      • From: Thomas Lachand-Robert <email@hidden>
References: 
 >How to force validation of a NSTextField? (From: Thomas Lachand-Robert <email@hidden>)

  • Prev by Date: Re: Make characters same width in textview
  • Next by Date: Re: Theory, Practice, Down-Time...
  • Previous by thread: Re: How to force validation of a NSTextField?
  • Next by thread: Re: How to force validation of a NSTextField?
  • Index(es):
    • Date
    • Thread