From b6b8ee6a8227d544bae58192527743cdb13e61e8 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 1 Mar 2014 14:05:14 -0500 Subject: [PATCH] Fixed the compiler errors on Mac OS X; now to get it running... --- delegatetypes_darwin.go | 4 ++-- uitask_darwin.go | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/delegatetypes_darwin.go b/delegatetypes_darwin.go index d9e420a..2bc3498 100644 --- a/delegatetypes_darwin.go +++ b/delegatetypes_darwin.go @@ -17,13 +17,13 @@ var ( _NSObject_Class = C.object_getClass(_NSObject) ) -func newDelegateClass(name string) (C.Class, error) { +func makeDelegateClass(name string) (C.Class, error) { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) c := C.objc_allocateClassPair(_NSObject_Class, cname, 0) if c == C.NilClass { - return fmt.Errorf("unable to create Objective-C class %s; reason unknown", name) + return C.NilClass, fmt.Errorf("unable to create Objective-C class %s; reason unknown", name) } C.objc_registerClassPair(c) return c, nil diff --git a/uitask_darwin.go b/uitask_darwin.go index ccc659d..4417528 100644 --- a/uitask_darwin.go +++ b/uitask_darwin.go @@ -21,6 +21,10 @@ We will create an Objective-C class goAppDelegate. It contains two methods: // extern void appDelegate_uitask(id, SEL, id); import "C" +// temporary for now +func msgBox(string, string){} +func msgBoxError(string, string){} + var uitask chan func() var mtret chan interface{} @@ -43,7 +47,7 @@ func ui(initDone chan error) { mtret = make(chan interface{}) go mainThread() v := <-mtret - if err, ok := v.(error); err { + if err, ok := v.(error); ok { initDone <- fmt.Errorf("error initializing Cocoa: %v", err) return }