PDA

View Full Version : ToolBar to change pannels




cpuin
Jun 20, 2013, 03:53 PM
I created a simple app with NSToolbar.
I've made 3 icons binded to a method which must change the content of the main window:


- (IBAction) setPanel:(id)sender
{
if ([sender tag]==0)
{
//set new document pannel
}
else if ([sender tag]==1)
{
//set new documents pannel
}
else if ([sender tag]==2)
{
//set new settings pannel
}

}


My question is how to change the current content of the window with one from another xib file?



chown33
Jun 20, 2013, 04:16 PM
Put an NSTabView in your window. Give it one of the NSTabViewTypes that start with "NSNoTabs". Clicking a toolbar icon changes the tab index.


https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/TabView/TabView.html%23//apple_ref/doc/uid/10000074i

cpuin
Jul 5, 2013, 07:35 AM
Put an NSTabView in your window. Give it one of the NSTabViewTypes that start with "NSNoTabs". Clicking a toolbar icon changes the tab index.


https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/TabView/TabView.html%23//apple_ref/doc/uid/10000074i

Thanks a lot.Unfortunately i can't find how to make it using xib files for the different tabs.I don't know how to make NSView to init with XIB.