Re: Nested NSViews and keyboard focus
Re: Nested NSViews and keyboard focus
- Subject: Re: Nested NSViews and keyboard focus
- From: Jacob Lukas <email@hidden>
- Date: Fri, 21 Dec 2007 12:12:56 -0500
On Dec 21, 2007, at 10:52, Nathan Auch wrote:
The installer I'm working on has a main window containing a few push
buttons and an NSBox. As the user moves through the installer, I use
the setContentView method on the NSBox to replace the contents of
the box with the view for the current "panel" of the install. These
panels are really just grouping of other standard controls and are
implemented as custom NSViews in IB. Some of these panels contain
multiple text fields. There are 2 problems I am seeing.
1. I cannot get any of the NSTextFields to automatically become the
first responder in the window after switching the NSBox's content
view.
2. Hitting TAB in one of the NSTextFields on the custom view does
not move to the next one.
I've tried using various combinations of overriding canBecomeKeyView
and acceptsFirstResponder on my custom view but it doesn't seem to
make any difference. I'm new to Cocoa, so I'm sure I'm just missing
something obvious. Is using a custom NSView in this case even the
right thing to do? I just need to have a way to represent a grouping
of controls in IB that I can swap in and out of the main window as
appropriate.
What about using a tab-less NSTabView? Or you might want to look at
NSWindow's recalculateKeyViewLoop or setAutorecalculatesKeyViewLoop.
-Jacob
_______________________________________________
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