summaryrefslogtreecommitdiff
path: root/prevlib/delegate_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-02 22:53:03 -0400
committerPietro Gagliardi <[email protected]>2014-07-02 22:53:03 -0400
commit8a81650b3da7ce00725336df9e03b38e935c5a65 (patch)
tree08af843f0460e7226f305cf7162021ef54e8c3f7 /prevlib/delegate_darwin.go
parent4dd5ceb11d62bd6b9af4847936314a9d8c45707f (diff)
Moved it all back; the preemptive multitaksing during an event handler kills us on all platforms. Going to have to restrict ALL GUI accss to happening from one t hread, so going to need to drop uitask entirely and have just a start() callback for startup code and a post() function for posting requests to windows (like channel sends but into a perpetual buffer).
Diffstat (limited to 'prevlib/delegate_darwin.go')
-rw-r--r--prevlib/delegate_darwin.go46
1 files changed, 0 insertions, 46 deletions
diff --git a/prevlib/delegate_darwin.go b/prevlib/delegate_darwin.go
deleted file mode 100644
index b1daece..0000000
--- a/prevlib/delegate_darwin.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// 27 february 2014
-
-package ui
-
-/*
-This creates a class goAppDelegate that will be used as the delegate for /everything/. Specifically, it:
- - runs uitask requests (uitask:)
- - handles window close events (windowShouldClose:)
- - handles window resize events (windowDidResize:)
- - handles button click events (buttonClicked:)
- - handles the application-global Quit event (such as from the Dock) (applicationShouldTerminate)
-*/
-
-// #include <stdlib.h>
-// #include "objc_darwin.h"
-import "C"
-
-var (
- appDelegate C.id
-)
-
-func makeAppDelegate() {
- appDelegate = C.makeAppDelegate()
-}
-
-//export appDelegate_windowShouldClose
-func appDelegate_windowShouldClose(win C.id) C.BOOL {
- sysData := getSysData(win)
- return toBOOL(sysData.close())
-}
-
-//export appDelegate_windowDidResize
-func appDelegate_windowDidResize(win C.id) {
- s := getSysData(win)
- wincv := C.windowGetContentView(win) // we want the content view's size, not the window's
- r := C.frame(wincv)
- // (0,0) is the bottom left corner but this is handled in sysData.translateAllocationCoords()
- s.resizeWindow(int(r.width), int(r.height))
- C.display(win) // redraw everything
-}
-
-//export appDelegate_buttonClicked
-func appDelegate_buttonClicked(button C.id) {
- sysData := getSysData(button)
- sysData.event()
-}