summaryrefslogtreecommitdiff
path: root/dialog_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-30 23:01:08 -0400
committerPietro Gagliardi <[email protected]>2014-08-30 23:01:08 -0400
commit155899c65ed32245e2ccad4197a10c77017d835b (patch)
tree4c337130ff5d1640efc1e94258ab3b8a9eef0c55 /dialog_darwin.m
parent3d4e54822dc6117306d5a4ac0e79017c4810b657 (diff)
Out with the old...
Diffstat (limited to 'dialog_darwin.m')
-rw-r--r--dialog_darwin.m45
1 files changed, 0 insertions, 45 deletions
diff --git a/dialog_darwin.m b/dialog_darwin.m
deleted file mode 100644
index 226ad4b..0000000
--- a/dialog_darwin.m
+++ /dev/null
@@ -1,45 +0,0 @@
-// 15 may 2014
-
-#include "objc_darwin.h"
-#include "_cgo_export.h"
-#import <AppKit/NSAlert.h>
-#import <AppKit/NSWindow.h>
-#import <AppKit/NSApplication.h>
-
-#define to(T, x) ((T *) (x))
-#define toNSWindow(x) to(NSWindow, (x))
-
-static intptr_t alert(id parent, NSString *primary, NSString *secondary, NSAlertStyle style)
-{
- NSAlert *box;
-
- box = [NSAlert new];
- [box setMessageText:primary];
- if (secondary != nil)
- [box setInformativeText:secondary];
- [box setAlertStyle:style];
- // TODO is there a named constant? will also need to be changed when we add different dialog types
- [box addButtonWithTitle:@"OK"];
- if (parent == nil)
- return (intptr_t) [box runModal];
- else {
- NSInteger ret;
-
- [box beginSheetModalForWindow:toNSWindow(parent)
- modalDelegate:[NSApp delegate]
- didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
- contextInfo:&ret];
- // TODO
- return (intptr_t) ret;
- }
-}
-
-void msgBox(id parent, id primary, id secondary)
-{
- alert(parent, (NSString *) primary, (NSString *) secondary, NSInformationalAlertStyle);
-}
-
-void msgBoxError(id parent, id primary, id secondary)
-{
- alert(parent, (NSString *) primary, (NSString *) secondary, NSCriticalAlertStyle);
-}