forked from reuben/coccinellida
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppController.m
55 lines (42 loc) · 1.43 KB
/
AppController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// AppController.m
// Coccinellida
//
// Licensed under GPL v3 Terms
//
// Created by Dmitry Geurkov on 9/25/09.
// Copyright 2009-2011. All rights reserved.
//
#import "AppController.h"
#import "Tunnel.h"
@implementation AppController
- (id) init {
if(self = [super init]){
//NSRect screenSize = [[NSScreen mainScreen] visibleFrame];
}
return (self);
}
- (void) awakeFromNib {
[aboutLabel setStringValue: [NSString stringWithFormat: @"%@ v%@", [aboutLabel stringValue], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]];
statusBarItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
NSImage *statusBarImage = [NSImage imageNamed:@"taskicon"];
[statusBarItem setMenu: statusMenu];
[statusBarItem setToolTip: @"Coccinellida Tunnel"];
[statusBarItem setEnabled: YES];
[statusBarItem setImage:statusBarImage];
[statusBarItem setAlternateImage:statusBarImage];
[statusBarItem setHighlightMode:YES];
[statusMenu setAutoenablesItems: NO];
[NSApp setMainMenu:dummyMenu];
}
- (IBAction) showAboutWindow: (id) sender {
if(![aboutWindow isVisible]){
NSRect screenSize = [[NSScreen mainScreen] visibleFrame];
NSRect w = [aboutWindow frame];
w.origin.x = screenSize.size.width - w.size.width - 20;
w.origin.y = screenSize.size.height - w.size.height - 20;
[aboutWindow setFrameOrigin: w.origin];
[aboutWindow orderFront: sender];
}
}
@end