raze-gles/polymer/build/src/osxbits.m
Plagman 09f0c239b6 Importing source for great justice
git-svn-id: https://svn.eduke32.com/eduke32@5 1a8010ca-5511-0410-912e-c29ae57300e0
2006-04-13 20:47:06 +00:00

37 lines
788 B
Objective-C

#include "osxbits.h"
#include <Cocoa/Cocoa.h>
int osx_msgbox(char *name, char *msg)
{
NSAlert *alert = [[NSAlert alloc] init];
NSString *mmsg = [[NSString alloc] initWithCString: msg];
[alert addButtonWithTitle: @"OK"];
[alert setMessageText: mmsg];
[alert setAlertStyle: NSInformationalAlertStyle];
[alert runModal];
[alert release];
[mmsg release];
return 0;
}
int osx_ynbox(char *name, char *msg)
{
NSAlert *alert = [[NSAlert alloc] init];
NSString *mmsg = [[NSString alloc] initWithCString: msg];
int r;
[alert addButtonWithTitle:@"Yes"];
[alert addButtonWithTitle:@"No"];
[alert setMessageText: mmsg];
[alert setAlertStyle: NSInformationalAlertStyle];
r = ([alert runModal] == NSAlertFirstButtonReturn);
[alert release];
[mmsg release];
return r;
}