summaryrefslogtreecommitdiff
path: root/src/window.mm
blob: f631f17de145b25e961f7995a700f9f8e06a8ba8 (plain) (blame)
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
//
//  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);
}