forked from ryanjafari/CSRichTextEditor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAppController.j
44 lines (32 loc) · 1.27 KB
/
AppController.j
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
/*
* AppController.j
* NewApplication
*
* Created by You on July 5, 2009.
* Copyright 2009, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@import <AppKit/CPToolbar.j>
@import <AppKit/CPToolbarItem.j>
@import <AppKit/CPOutlineView.j>
@import "com/cetrasoft/components/formatbar/CSRichTextEditor.j"
@implementation AppController : CPObject { }
- (void)applicationDidFinishLaunching:(CPNotification)aNotification {
// The main window and friends. We can also use mainWindow here
// (and keyWindow too, since the mainWindow happens to be the
// keyWindow at this point in time).
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask];
var frame = [theWindow frame];
var contentView = [theWindow contentView];
// Bring forward the window
[theWindow orderFront:self];
//var mainWindow = [[CPApplication sharedApplication] mainWindow];
//var contentView = [mainWindow contentView];
//var frame = [mainWindow frame];
var w = CGRectGetWidth(frame);
var h = CGRectGetHeight(frame);
var richTextEditor = [[CSRichTextEditor alloc] initWithFrame:CGRectMake(0,0,w,h)];
[contentView addSubview:richTextEditor];
//[[mainWindow contentView] addSubview:richTextEditor];
}
@end