Hi Abhijeet,

> Hi,I have a single window with a toolbar and a custom view in my application. 
> Toolbar has Back and Next button on it. This is my MainMenu.xib. I have 5 
> more xibs other than the MainMenu.xib in my application. Each xib contains 
> one view with different controls in it. On Next and Back button click on my 
> Main window the current view is swapped with another view. On my first view 
> there is a NSPopupButton. I want when the first view is displayed the 
> keyboard focus should be on NSPopupButton and on tab key press it should move 
> to next control in the tab order. Basically I want my user to be able to use 
> the tab control to change the keyboard focus in all my views.


In IB, set your window to "auto recalculates view loop". To be positive, you 
can also set that on the window when you load your new view. The technique that 
I use for making a particular control first responder is to put a common tag on 
it (say 2112) which you use to get the control without requiring an outlet. 
Then in awake from nib you can do

NSControl *control = [[self view] viewWithTag:2112];
[[[self view] window] makeFirstResponder:control];

if all of your views have a common superclass, you can put that code in the 
superclass.

Hope this helps
Marc
_______________________________________________

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

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

Reply via email to