Improved the error reporting facilities of uiinit() on Mac OS X. Not used yet, though...
This commit is contained in:
parent
37b1c3309b
commit
a172143fe6
|
@ -38,7 +38,7 @@ struct xpoint {
|
|||
|
||||
/* uitask_darwin.m */
|
||||
extern id getAppDelegate(void); /* used by the other .m files */
|
||||
extern BOOL uiinit(void);
|
||||
extern void uiinit(char **);
|
||||
extern void uimsgloop(void);
|
||||
extern void uistop(void);
|
||||
extern void issue(void *);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
package ui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
|
@ -12,8 +13,13 @@ import (
|
|||
import "C"
|
||||
|
||||
func uiinit() error {
|
||||
// TODO check error
|
||||
C.uiinit()
|
||||
var errmsg *C.char
|
||||
|
||||
errmsg = nil
|
||||
C.uiinit(&errmsg)
|
||||
if errmsg != nil {
|
||||
return fmt.Errorf("package ui initialization failed: %s", C.GoString(errmsg))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ id getAppDelegate(void)
|
|||
return appDelegate;
|
||||
}
|
||||
|
||||
BOOL uiinit(void)
|
||||
void uiinit(char **errmsg)
|
||||
{
|
||||
areaClass = getAreaClass();
|
||||
appDelegate = [appDelegateClass new];
|
||||
|
@ -66,7 +66,6 @@ BOOL uiinit(void)
|
|||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||
[NSApp activateIgnoringOtherApps:YES]; // TODO rsc does this; finder says NO?
|
||||
[NSApp setDelegate:appDelegate];
|
||||
return YES;
|
||||
}
|
||||
|
||||
void uimsgloop(void)
|
||||
|
|
Loading…
Reference in New Issue