Fixed the compiler errors on Mac OS X; now to get it running...
This commit is contained in:
parent
00243442d2
commit
b6b8ee6a82
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue