Created
May 13, 2013 12:33
-
-
Save maxsteenbergen/5568001 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// WOMAppDelegate.m | |
// PopoverMenulet | |
// | |
// Created by Julián Romero on 10/26/11. | |
// Copyright (c) 2011 Wuonm Web Services S.L. All rights reserved. | |
// | |
#import "WOMAppDelegate.h" | |
#import "WOMMenulet.h" | |
#import "WOMController.h" | |
@implementation WOMAppDelegate | |
@synthesize window = _window; | |
@synthesize menulet; | |
@synthesize statusItem; | |
@synthesize statusImage; | |
@synthesize controller; | |
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | |
{ | |
//SET UP NSSTATUSITEM | |
self.statusImage = [NSImage imageNamed:@"basket"]; | |
self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:18]; | |
[self.statusItem setImage:statusImage]; | |
//[self.statusItem setHighlightMode:YES]; | |
[self.statusItem setEnabled:YES]; | |
self.menulet = [[WOMMenulet alloc] init]; /* square item */ | |
self.controller = [[WOMController alloc] init]; | |
self.menulet.delegate = controller; | |
//AS SOON AS THIS CODE IS CALLED, THE ICON IS RELEASED | |
[self.statusItem setView:menulet]; | |
} | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// WOMAppDelegate.h | |
// PopoverMenulet | |
// | |
// Created by Julián Romero on 10/26/11. | |
// Copyright (c) 2011 Wuonm Web Services S.L. All rights reserved. | |
// | |
#import <Cocoa/Cocoa.h> | |
@class WOMMenulet; | |
@class WOMController; | |
@interface WOMAppDelegate : NSObject <NSApplicationDelegate> | |
@property (unsafe_unretained) IBOutlet NSWindow *window; | |
@property (nonatomic, strong) WOMMenulet *menulet; | |
@property (strong) NSStatusItem *statusItem; | |
@property (strong) NSImage *statusImage; | |
@property (nonatomic, strong) WOMController *controller; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment