summaryrefslogtreecommitdiff
path: root/src/window.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.mm')
-rw-r--r--src/window.mm26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/window.mm b/src/window.mm
new file mode 100644
index 00000000..f631f17d
--- /dev/null
+++ b/src/window.mm
@@ -0,0 +1,26 @@
+//
+// window.m
+// themanaworld
+//
+// Created by David Athay on 1/27/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "window.h"
+#import <Cocoa/Cocoa.h>
+
+void setIcon(const char *icon)
+{
+ NSString *path = [NSString stringWithCString:icon
+ encoding:[NSString defaultCStringEncoding]];
+ NSString *imageName = [[NSBundle mainBundle] pathForResource:path ofType:@"icns" inDirectory:@"data/icons"];
+ NSImage *iconImage = [[NSImage alloc] initWithContentsOfFile:imageName];
+ [NSApp setApplicationIconImage: iconImage];
+}
+
+void windowAlert(const char *msg)
+{
+ NSString *alertText = [NSString stringWithCString:msg
+ encoding:[NSString defaultCStringEncoding]];
+ NSRunAlertPanel(nil, alertText , @"OK", nil, nil);
+} \ No newline at end of file