On Aug 2, 2015, at 11:01 PM, Graham Cox <graham....@bigpond.com> wrote:

> On 3 Aug 2015, at 12:13 pm, Ken Thomases <k...@codeweavers.com> wrote:
>> 
>> You can try [[self window] selectKeyViewFollowingView:control] instead.
> 
> Great! That works fine.

Glad to hear it.


> 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.

The default implementation of -canBecomeMainWindow returns NO for panels.  Is 
your window intended to be the main window?  Is it actually?  Does it change 
anything if you add an override to return YES?


> 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.

Are you aware that NSTabViewItem has its own initialFirstResponder property?  
Have you tried using that?

Regards,
Ken


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to