Re: Programmatically switching text fields
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