summaryrefslogtreecommitdiff
path: root/delegate_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-30 09:57:44 -0400
committerPietro Gagliardi <[email protected]>2014-06-30 09:57:44 -0400
commit33155f7496a818a1ed83fe49cccb63be7842bc81 (patch)
treebbb14af3d92becf7d5ca5abfb28630a2b413ad93 /delegate_darwin.go
parente032807546a96e6489d18a0e42ced51b7c31a55c (diff)
Reverted everything back to the old API.
Diffstat (limited to 'delegate_darwin.go')
-rw-r--r--delegate_darwin.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/delegate_darwin.go b/delegate_darwin.go
index 27031c3..7d21c3d 100644
--- a/delegate_darwin.go
+++ b/delegate_darwin.go
@@ -24,11 +24,9 @@ func makeAppDelegate() {
}
//export appDelegate_windowShouldClose
-func appDelegate_windowShouldClose(win C.id) C.BOOL {
+func appDelegate_windowShouldClose(win C.id) {
sysData := getSysData(win)
- b := false // TODO
- sysData.close(&b)
- return toBOOL(b)
+ sysData.signal()
}
//export appDelegate_windowDidResize
@@ -44,5 +42,13 @@ func appDelegate_windowDidResize(win C.id) {
//export appDelegate_buttonClicked
func appDelegate_buttonClicked(button C.id) {
sysData := getSysData(button)
- sysData.event()
+ sysData.signal()
+}
+
+//export appDelegate_applicationShouldTerminate
+func appDelegate_applicationShouldTerminate() {
+ // asynchronous so as to return control to the event loop
+ go func() {
+ AppQuit <- struct{}{}
+ }()
}