diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-02 22:53:03 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-02 22:53:03 -0400 |
| commit | 8a81650b3da7ce00725336df9e03b38e935c5a65 (patch) | |
| tree | 08af843f0460e7226f305cf7162021ef54e8c3f7 /objc_darwin.go | |
| parent | 4dd5ceb11d62bd6b9af4847936314a9d8c45707f (diff) | |
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).
Diffstat (limited to 'objc_darwin.go')
| -rw-r--r-- | objc_darwin.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/objc_darwin.go b/objc_darwin.go new file mode 100644 index 0000000..15027e4 --- /dev/null +++ b/objc_darwin.go @@ -0,0 +1,39 @@ +// 28 february 2014 + +package ui + +import ( + "unsafe" +) + +// #include <stdlib.h> +// #include "objc_darwin.h" +import "C" + +func toNSString(str string) C.id { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + + return C.toNSString(cstr) +} + +func fromNSString(str C.id) string { + return C.GoString(C.fromNSString(str)) +} + +func toBOOL(what bool) C.BOOL { + if what { + return C.YES + } + return C.NO +} + +// These consolidate the NSScrollView code (used by listbox_darwin.go and area_darwin.go) into a single place. + +func makeScrollView(content C.id) C.id { + return C.makeScrollView(content) +} + +func getScrollViewContent(scrollview C.id) C.id { + return C.scrollViewContent(scrollview) +} |
