Files
cappuccino/Tests/Manual/CPTabViewNib/AppController.j
T
cacaodev 7a41282912 CPTabView: Fix a bug where a CPTabView would not reflect immediately the replacement of the selected item's view.
Updated CPTabViewNib to show a setView: on the current item.

If the view changes on a non selected item, the tabView content will be
updated when this item is selected.
2012-01-26 14:45:42 +01:00

43 lines
1.1 KiB
Plaintext

/*
* AppController.j
* CPTabViewNib
*
* Created by Alexander Ljungberg on November 5, 2010.
* Copyright 2010, WireLoad, LLC All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
@outlet CPTabView nibTabView;
}
- (IBAction)changeView:(id)sender
{
var item = [nibTabView selectedTabViewItem],
view = [[CPView alloc] initWithFrame:CGRectMakeZero()];
[view setBackgroundColor:[CPColor redColor]];
[item setView:view];
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullBridge:YES];
}
@end