diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-01 22:40:14 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-01 22:40:14 -0500 |
| commit | 3e44abc1b862d778c5b0ae01c353fd2c713ca359 (patch) | |
| tree | e03506987fd65b7fed3bf0005130dff5a1dcbac5 /darwintest/delegate.go | |
| parent | 4599e0d25ea304bd78f87bc87265a2eedf9a7999 (diff) | |
Now that we have everything up to and including Buttons up and running, we no longer need the darwintest.
Diffstat (limited to 'darwintest/delegate.go')
| -rw-r--r-- | darwintest/delegate.go | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/darwintest/delegate.go b/darwintest/delegate.go deleted file mode 100644 index d0cd3e7..0000000 --- a/darwintest/delegate.go +++ /dev/null @@ -1,43 +0,0 @@ -// 28 february 2014 -package main - -import ( - "fmt" -) - -// #cgo LDFLAGS: -lobjc -framework Foundation -framework AppKit -// #include "objc_darwin.h" -// extern void windowShouldClose(id, SEL, id); -// extern void buttonClicked(id, SEL, id); -// extern void gotNotification(id, SEL, id); -import "C" - -// TODO move these around later -var ( - _stop = sel_getUid("stop:") -) - -//export windowShouldClose -func windowShouldClose(self C.id, sel C.SEL, sender C.id) { - fmt.Println("-[hello windowShouldClose:]") - C.objc_msgSend_id(NSApp, _stop, sender) -} - -//export buttonClicked -func buttonClicked(self C.id, sel C.SEL, sender C.id) { - fmt.Println("button clicked; sending notification...") - notify("button") -} - -//export gotNotification -func gotNotification(self C.id, sel C.SEL, object C.id) { - fmt.Printf("got notification from %s\n", fromNSString(object)) -} - -func mk(name string, selW C.SEL, selB C.SEL, selN C.SEL) C.id { - class := newClass(name) - addDelegateMethod(class, selW, C.windowShouldClose) - addDelegateMethod(class, selB, C.buttonClicked) - addDelegateMethod(class, selN, C.gotNotification) - return objc_getClass(name) -} |
