From 3e44abc1b862d778c5b0ae01c353fd2c713ca359 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 1 Mar 2014 22:40:14 -0500 Subject: Now that we have everything up to and including Buttons up and running, we no longer need the darwintest. --- darwintest/delegate.go | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 darwintest/delegate.go (limited to 'darwintest/delegate.go') 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) -} -- cgit v1.2.3