Re: Programmatically switching text fields
Re: Programmatically switching text fields
- Subject: Re: Programmatically switching text fields
- From: Uli Kusterer <email@hidden>
- Date: Tue, 04 Aug 2015 17:37:48 +0200
On 03 Aug 2015, at 06:01, Graham Cox <email@hidden> wrote:
> 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.
Is your window key and visible at the time when you select the other view? Have you tried calling makeKeyAndOrderFront: on it to see if that fixes things? This is really one of those cases that should Just Work™, so I'm kinda confused why you have to do so much delegate stuff.
Have you tried making a version without the tab view? If that is broken as well, then it's not related to tab views.
FWIW, tab views probably still remove views on tabs that aren't current from the view hierarchy (Cocoa didn't have view hiding until ~10.2), so it could of course be related to that.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachtText are everywhere..."
_______________________________________________
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