summaryrefslogtreecommitdiff
path: root/delegate_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-30 22:48:12 -0400
committerPietro Gagliardi <[email protected]>2014-06-30 22:48:12 -0400
commitffa1bbe0b91a8c812ddcea5c5d65e55f60d07f33 (patch)
tree000fadd9af11843d92e7f0eee49fa90cca1379cd /delegate_darwin.go
parent990d50e9a153681a091a23734f8962e728fde1b0 (diff)
Restored the previous new API. I'm going to change it so that events are callbacks rather than using a window handler, but other than that... yeah.
Diffstat (limited to 'delegate_darwin.go')
-rw-r--r--delegate_darwin.go16
1 files changed, 5 insertions, 11 deletions
diff --git a/delegate_darwin.go b/delegate_darwin.go
index 7d21c3d..27031c3 100644
--- a/delegate_darwin.go
+++ b/delegate_darwin.go
@@ -24,9 +24,11 @@ func makeAppDelegate() {
}
//export appDelegate_windowShouldClose
-func appDelegate_windowShouldClose(win C.id) {
+func appDelegate_windowShouldClose(win C.id) C.BOOL {
sysData := getSysData(win)
- sysData.signal()
+ b := false // TODO
+ sysData.close(&b)
+ return toBOOL(b)
}
//export appDelegate_windowDidResize
@@ -42,13 +44,5 @@ func appDelegate_windowDidResize(win C.id) {
//export appDelegate_buttonClicked
func appDelegate_buttonClicked(button C.id) {
sysData := getSysData(button)
- sysData.signal()
-}
-
-//export appDelegate_applicationShouldTerminate
-func appDelegate_applicationShouldTerminate() {
- // asynchronous so as to return control to the event loop
- go func() {
- AppQuit <- struct{}{}
- }()
+ sysData.event()
}