-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwin2.js
39 lines (27 loc) · 909 Bytes
/
win2.js
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
// Generated by CoffeeScript 1.9.0
(function() {
var app, win;
ObjC["import"]('Cocoa');
ObjC.registerSubclass({
name: 'WinDelegate',
superclass: 'NSObject',
protocols: ['NSWindowDelegate'],
methods: {
'windowWillClose:': {
types: ['void', ['id']],
implementation: function(notification) {
return app.terminate(0);
}
}
}
});
win = $.NSWindow.alloc.initWithContentRectStyleMaskBackingDefer($.NSMakeRect(0, 0, 160, 90), $.NSTitledWindowMask | $.NSMiniaturizableWindowMask | $.NSClosableWindowMask, $.NSBackingStoreBuffered, false);
win.delegate = $.WinDelegate.alloc.init;
win.title = 'my win2';
win.center;
win.makeKeyAndOrderFront(win);
app = $.NSApplication.sharedApplication;
app.setActivationPolicy($.NSApplicationActivationPolicyRegular);
app.activateIgnoringOtherApps(true);
app.run();
}).call(this);