• 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: Programmatically switching text fields
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programmatically switching text fields


  • Subject: Re: Programmatically switching text fields
  • From: Graham Cox <email@hidden>
  • Date: Mon, 03 Aug 2015 14:01:26 +1000

> On 3 Aug 2015, at 12:13 pm, Ken Thomases <email@hidden> wrote:
>
> You can try [[self window] selectKeyViewFollowingView:control] instead.


Great! That works fine.

The only problem remaining then is that the first field isn’t properly selected when the window shows up - it is initialFirstResponder and gets the key focus ring, but you can actually type text until you click in it again.

> Are you certain the window is key?  Does your app do anything unusual with activationPolicy or activation, generally?

I don’t do anything unusual that I can see - it’s a fairly simple NSPanel.

Thinking further, I do have a NSTabView between the window and these fields, and the tab on which the fields are placed are not on the default tab. I seem to recall there were issues with tab views a long time ago, and perhaps it’s naive to assume they’re fixed. It’s also probable that setting initialFirstResponder to an item that’s not on the displayed tab might fail, though it’s weird that it leaves it in a half-selected state. I’ll look at responding to the tab delegate methods to select the field when the tab is switched.

—Graham



_______________________________________________

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: Programmatically switching text fields
      • From: Uli Kusterer <email@hidden>
    • Re: Programmatically switching text fields
      • From: Ken Thomases <email@hidden>
References: 
 >Programmatically switching text fields (From: Graham Cox <email@hidden>)
 >Re: Programmatically switching text fields (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Programmatically switching text fields
  • Next by Date: Re: Programmatically switching text fields
  • Previous by thread: Re: Programmatically switching text fields
  • Next by thread: Re: Programmatically switching text fields
  • Index(es):
    • Date
    • Thread