02.06.2013
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.