diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-30 23:01:08 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-30 23:01:08 -0400 |
| commit | 155899c65ed32245e2ccad4197a10c77017d835b (patch) | |
| tree | 4c337130ff5d1640efc1e94258ab3b8a9eef0c55 /dialog_darwin.go | |
| parent | 3d4e54822dc6117306d5a4ac0e79017c4810b657 (diff) | |
Out with the old...
Diffstat (limited to 'dialog_darwin.go')
| -rw-r--r-- | dialog_darwin.go | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/dialog_darwin.go b/dialog_darwin.go deleted file mode 100644 index 421e838..0000000 --- a/dialog_darwin.go +++ /dev/null @@ -1,49 +0,0 @@ -// 2 march 2014 - -package ui - -import ( - "fmt" - "unsafe" -) - -// #include "objc_darwin.h" -import "C" - -//export dialog_send -func dialog_send(pchan unsafe.Pointer, res C.intptr_t) { - rchan := (*chan int)(pchan) - go func() { // send it in a new goroutine like we do with everything else - *rchan <- int(res) - }() -} - -func _msgBox(parent *Window, primarytext string, secondarytext string, style uintptr) Response { - var pwin C.id = nil - - if parent != dialogWindow { - pwin = parent.sysData.id - } - primary := toNSString(primarytext) - secondary := C.id(nil) - if secondarytext != "" { - secondary = toNSString(secondarytext) - } - switch style { - case 0: // normal - C.msgBox(pwin, primary, secondary) - return OK - case 1: // error - C.msgBoxError(pwin, primary, secondary) - return OK - } - panic(fmt.Errorf("unknown message box style %d\n", style)) -} - -func (w *Window) msgBox(primarytext string, secondarytext string) { - _msgBox(w, primarytext, secondarytext, 0) -} - -func (w *Window) msgBoxError(primarytext string, secondarytext string) { - _msgBox(w, primarytext, secondarytext, 1) -} |
