Skip to content

Instantly share code, notes, and snippets.

@tbalthazar
Created January 10, 2009 19:30
Show Gist options
  • Save tbalthazar/45540 to your computer and use it in GitHub Desktop.
Save tbalthazar/45540 to your computer and use it in GitHub Desktop.
/*
* AppController.j
*
* Created by __Me__ on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
var tabView = [[CPTabView alloc] initWithFrame:CGRectMake(100.0, 100.0, 300.0, 300.0)],
tabViewItemOne = [[CPTabViewItem alloc] initWithIdentifier:@"myTabOne"],
tabViewItemTwo = [[CPTabViewItem alloc] initWithIdentifier:@"myTabTwo"],
viewForTabItemOne = [[CPTextField alloc] initWithFrame:CGRectMakeZero()],
viewForTabItemTwo = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
[contentView addSubview:tabView];
[viewForTabItemOne setStringValue:@"This is the contents of the first tab."];
[viewForTabItemOne sizeToFit];
[viewForTabItemTwo setStringValue:@"This is the contents of the second tab."];
[viewForTabItemTwo sizeToFit];
[tabViewItemOne setLabel:@"Tab One"];
[tabViewItemOne setView:viewForTabItemOne];
[tabViewItemTwo setLabel:@"Tab Two"];
[tabViewItemTwo setView:viewForTabItemTwo];
[tabView addTabViewItem:tabViewItemOne];
[tabView addTabViewItem:tabViewItemTwo];
// [contentView addSubview:tabView];
[tabView selectFirstTabViewItem:self];
[theWindow orderFront:self];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment