diff options
| author | Grant Limberg <glimberg@gmail.com> | 2015-05-07 19:16:35 -0700 |
|---|---|---|
| committer | Grant Limberg <glimberg@gmail.com> | 2015-05-07 19:16:35 -0700 |
| commit | da45840e5ad87aa86f67fbe20d0cb003d982b0f0 (patch) | |
| tree | a74f5e982b61eb443ed9c28e24fd6f1e3977d427 /ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m | |
| parent | 8130b2a0de08409e8c22dc388101b6b3877469dc (diff) | |
| parent | 4426899e8c9469518325f39f173151b3535ac20e (diff) | |
| download | infinitytier-da45840e5ad87aa86f67fbe20d0cb003d982b0f0.tar.gz infinitytier-da45840e5ad87aa86f67fbe20d0cb003d982b0f0.zip | |
Merge branch 'adamierymenko-dev' into android-jni
Conflicts:
.gitignore
Diffstat (limited to 'ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m')
| -rw-r--r-- | ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m b/ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m new file mode 100644 index 00000000..2765a2e3 --- /dev/null +++ b/ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m @@ -0,0 +1,54 @@ +#import "WindowController.h" + + +@interface WindowController() { + +} + +-(void) notificationCenter; + +@end + +@implementation WindowController + +@synthesize contentView, url; + +- (id) initWithURL:(NSString *) relativeURL{ + self = [super initWithWindowNibName:@"Window"]; + self.url = [NSURL URLWithString:relativeURL relativeToURL:[[NSBundle mainBundle] resourceURL]]; + + [self.window setFrameAutosaveName:@"MacGapWindow"]; + [self notificationCenter]; + + return self; +} + +-(id) initWithRequest: (NSURLRequest *)request{ + self = [super initWithWindowNibName:@"Window"]; + [self notificationCenter]; + [[self.contentView.webView mainFrame] loadRequest:request]; + + return self; +} + +-(void) notificationCenter{ + [[NSNotificationCenter defaultCenter] addObserver:self.contentView + selector:@selector(windowResized:) + name:NSWindowDidResizeNotification + object:[self window]]; +} + +- (void)windowDidLoad +{ + [super windowDidLoad]; + + if (self.url != nil) { + [self.contentView.webView setMainFrameURL:[self.url absoluteString]]; + } + + + // Implement this method to handle any initialization after your + // window controller's window has been loaded from its nib file. +} + +@end |
