Re: Tab order in a view containing an NSTabView
Re: Tab order in a view containing an NSTabView
- Subject: Re: Tab order in a view containing an NSTabView
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 28 Jul 2003 21:56:00 -0400
on 03-07-28 2:52 PM, matt neuburg at email@hidden wrote:
>
On Thu, 24 Jul 2003 21:57:05 -0500, "John Debay" <email@hidden>
>
said:
>
> Hi,
>
>
>
> I have a quick question regarding how to properly set up the keyboard loop
>
> for a view containing an NSTabView. I have a series of controls that
>
> represents a form within my window. One of the controls needs to change
>
> between a text field and a popup button, depending on the context. This is
>
> implemented by switching between two tabs in a tab view with the tabs
>
> themselves hidden. The problem I'm having is with the tab order from the
>
> control in the tab view to the next control in the form. Basically, it
>
> doesn't work. I''ve been concentrating on just getting the text field in
>
one
>
> tab to work, and I'll worry about the popup button later. I've set the
>
> initial first responder of the tab view to the text field, and have
>
> experimented with setting the next key view of the text field, first to
>
the
>
> next element in the form (where I want the focus to go next, but is
>
outside
>
> of the tab view), then to the tab view, etc., and nothing has worked. When
>
> the text field in the tab view has the focus, hitting tab does nothing.
>
>
As far as I can tell, tabbing into and out of tab views doesn't work by
>
default. I think you can set this up in code by catching the Tab key at a
>
higher level, such as NSWindow's sendEvent:. m.
I believe it does now work (although nothing about tabbing order works
usefully "by default"; you have to set the order up yourself in IB with
initialFirstResponder and nextKeyView). It certainly didn't work a while
ago, but it was fixed a couple or more versions ago, as far as I can tell.
There was a good explanation of the theory of the fix, still available in
one of the "older" AppKit version release notes, and I think the theory
became reality a release or two later. A key aspect of the fix is to make
sure the tab view loop within any one tab view item is completely circular,
as I recall.
But none of that answers the question posed, which has to do with tab view
loops in tabless tab views. I ran into that recently. My preliminary opinion
is that you should violate the rule for tabbed tab views. That is, you
should tab from the last view in one tab view item out to the next view
outside the tab view, instead of back to the first item inside the tab view
item. But I'm not sure yet.
At least in my implementation, tabless tab views aren't meant to be
accessible by tab view order in the same way that tabbed tab views are. A
tabless tab view is kind of a kludge to switch groups of user controls in
and out under program control, not under direct user control. In other
words, the user should have to tab to some other user control to switch tab
view items in a tabless tab view.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.