/* * AppController.j * * Created by __Me__ on __Date__. * Copyright 2008 __MyCompanyName__. All rights reserved. */ @import @implementation AppController : CPObject { } - (void)applicationDidFinishLaunching:(CPNotification)aNotification { var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask], contentView = [theWindow contentView]; [self setupTabsInView: contentView]; [theWindow orderFront:self]; } - (void) setupTabsInView: (CPView) view { var bounds = [view bounds]; var tabView = [[CPTabView alloc] initWithFrame:bounds] [view addSubview: tabView] var tab1Item = [[CPTabViewItem alloc] initWithIdentifier: @"tab1"]; [tab1Item setLabel: @"Tab One"] tab1View = [[CPWebView alloc] initWithFrame:CGRectMake(0,0,150,150)] [tab1View loadHTMLString: @"

Tab One

"] [tab1Item setView: tab1View] [tabView addTabViewItem: tab1Item] // Comment out this entire stanza, and the first tab will display // properly (including its contents). // Note that the bug still exists even if the CPTabViewItem that's // created in this stanza isn't added to the CPTabView var tab2Item = [[CPTabViewItem alloc] initWithIdentifier: @"tab2"]; [tab2Item setLabel: @"Tab Two"] tab2View = [[CPWebView alloc] initWithFrame:CGRectMake(0,0,150,150)] [tab2View loadHTMLString: @"

Tab Two

"] [tab2Item setView: tab2View] [tabView addTabViewItem: tab2Item] } @end