Blog

Ashe Status Bar

As the number of hosted productivity and development tools we use continues to increase, it’s gotten to be a pain remembering all the URLs we use every day. We’ve all got bookmarks in our browsers, but there’s nothing authoritative about the URLs, nor is there an incentive to keep our workspaces tidy if we’re all keeping lists of links. The Ashe Status Bar mini-app aims to help us fix that in a small way.

It’s an internal tool that links to our private accounts so the code isn’t open, but here are some highlights:

AppDelegate.h:

@interface AppDelegate : NSObject
@property (assign) IBOutlet NSMenu *statusMenu;
@property (strong, nonatomic) NSStatusItem *statusBar;
-(IBAction)handleAsheChat:(id)sender;
-(IBAction)handleHarvest:(id)sender;
--SNIP--
@end

 

AppDelegate.m:

@implementation AppDelegate
@synthesize statusMenu;
@synthesize statusBar;
- (void) awakeFromNib {
    self.statusBar = [[NSStatusBar systemStatusBar] 
                     statusItemWithLength:NSVariableStatusItemLength];
    self.statusBar.image = [NSImage imageNamed:@"icon.png"];
    self.statusBar.alternateImage = [NSImage imageNamed:@"icon_inverted.png"];
    self.statusBar.menu = self.statusMenu;
    self.statusBar.highlightMode = YES;
}
-(IBAction)handleHarvest:(id)sender {
    NSString *applicationURL = @"[HARVEST URL]";
    [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:applicationURL]];
}
--SNIP--
@end

 

Throw in a Menu xib, hook up the outlets and selectors, and you’re in business.

Tim Boisvert

Tim Boisvert is Director of Technology at Ashe Avenue. @timboisvert

blog comments powered by Disqus
LinkedIn Made in NY

Brooklyn

67 West St.
Floor 4 (Greendesk, #C6)
Brooklyn, NY 11222

Chapel Hill

1506 E Franklin St.
Suite 300
Chapel Hill, NC 27514