From 8a81650b3da7ce00725336df9e03b38e935c5a65 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 2 Jul 2014 22:53:03 -0400 Subject: Moved it all back; the preemptive multitaksing during an event handler kills us on all platforms. Going to have to restrict ALL GUI accss to happening from one t hread, so going to need to drop uitask entirely and have just a start() callback for startup code and a post() function for posting requests to windows (like channel sends but into a perpetual buffer). --- prevlib/dialog_darwin.go | 49 ------------------------------------------------ 1 file changed, 49 deletions(-) delete mode 100644 prevlib/dialog_darwin.go (limited to 'prevlib/dialog_darwin.go') diff --git a/prevlib/dialog_darwin.go b/prevlib/dialog_darwin.go deleted file mode 100644 index 421e838..0000000 --- a/prevlib/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) -} -- cgit v1.2.3