Skip to content

Instantly share code, notes, and snippets.

@justingraves
Created May 4, 2010 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justingraves/388797 to your computer and use it in GitHub Desktop.
Save justingraves/388797 to your computer and use it in GitHub Desktop.
/*
* AppController.j
* Social Radar
*
* Created by You on April 25, 2010.
* Copyright 2010, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@import <AppKit/CPTabView.j>
@import <SocialRadar/SRRibbon.j>
@import <SocialRadar/SRPageView.j>
@implementation AppController : CPObject
{
CPWindow mainWindow;
CPView mainContentView;
SRRibbon ribbon; // Top toolbar
CPTabView tabBar; // Tab bar at the top of the page view
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var mainWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
mainContentView = [mainWindow contentView];
ribbon = [[SRRibbon alloc] initWithIdentifier:"Ribbon"];
[ribbon setDelegate:self];
[ribbon setVisible:YES];
[mainWindow setToolbar:ribbon];
[mainWindow orderFront:self];
}
// Return an array of toolbar item identifier (all the toolbar items that may be present in the toolbar)
- (CPArray)toolbarAllowedItemIdentifiers:(CPToolbar)aToolbar
{
return [CPToolbarFlexibleSpaceItemIdentifier, CPToolbarFlexibleSpaceItemIdentifier];
}
// Return an array of toolbar item identifier (the default toolbar items that are present in the toolbar)
- (CPArray)toolbarDefaultItemIdentifiers:(CPToolbar)aToolbar
{
return [self toolbarAllowedItemIdentifiers:aToolbar];
}
- (CPToolbarItem)toolbar:(CPToolbar)aToolbar itemForItemIdentifier:(CPString)anItemIdentifier willBeInsertedIntoToolbar:(BOOL)aFlag
{
var toolbarItem = [[CPToolbarItem alloc] initWithItemIdentifier:anItemIdentifier];
var mainBundle = [CPBundle mainBundle];
return toolbarItem;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment