• 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: Modal panel and -initialFirstResponder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modal panel and -initialFirstResponder


  • Subject: Re: Modal panel and -initialFirstResponder
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 20 Jul 2011 02:00:31 -0700

On Jul 19, 2011, at 23:28, Vincent wrote:

> More specifically, I have a NSPanel, with some NSTextField inside, and would like the editing to begin immediately in the first text field when the panel appears. I thus set the initialFirstResponder outlet to the field I’d like the edition to start in. But when the panel shows (modally), all the fields are inactive: I have to explicitly select one of them by clicking.
>
> I’ve tried to call -setFirstResponder: with my NSTextField as parameter (or even -[myTextField performClick:]) inside the -didBecomeKey delegate methods, to no avail.

What does "shows (modally)" mean?

The initial first responder is the view that's *going to be* the first responder, when it's window becomes key. Panels don't become key at the same times as regular windows, so it's possible you need to call 'makeKeyAndOrderFront:' on the panel after showing it. Also, panels can be configured to become key "only when necessary", meaning you need to click on something that accepts first responder status in order to make the window key. You should check the setting of that property, too.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Modal panel and -initialFirstResponder
      • From: Vincent Habchi <email@hidden>
References: 
 >Modal panel and -initialFirstResponder (From: Vincent <email@hidden>)

  • Prev by Date: Best way to do static overlay over scrolling content?
  • Next by Date: Re: Best way to do static overlay over scrolling content?
  • Previous by thread: Modal panel and -initialFirstResponder
  • Next by thread: Re: Modal panel and -initialFirstResponder
  • Index(es):
    • Date
    • Thread