Native Mac OS X OtaClock replica
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AppDelegate.m 847B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // AppDelegate.m
  3. // OtaClock
  4. //
  5. // Created by Thomas Buck on 16.08.15.
  6. // Copyright (c) 2015 xythobuz. All rights reserved.
  7. //
  8. #import "AppDelegate.h"
  9. @interface AppDelegate ()
  10. @property (weak) IBOutlet NSWindow *window;
  11. @end
  12. @implementation AppDelegate
  13. @synthesize statusItem;
  14. @synthesize mainMenu;
  15. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
  16. // Create Status Bar Item
  17. statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
  18. statusItem.image = [NSImage imageNamed:@"Menu"];
  19. statusItem.highlightMode = YES;
  20. statusItem.menu = mainMenu; // Use same menu used for right-clicks
  21. }
  22. - (void)applicationWillTerminate:(NSNotification *)aNotification {
  23. // Remove Status Bar Item
  24. [[NSStatusBar systemStatusBar] removeStatusItem:statusItem];
  25. }
  26. @end