summaryrefslogtreecommitdiff
path: root/sysdata_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-01 17:15:26 -0500
committerPietro Gagliardi <[email protected]>2014-03-01 17:15:26 -0500
commit5caf0fe84a81e5adbe18568eabe06f2ec674c1b3 (patch)
tree63dc442f3a40aaf1118b6a4885b8e778265d8fa2 /sysdata_darwin.go
parent8b497b2188bc735710a6ef83b0b05487a4b3ee83 (diff)
Cleaned up loose ends with the previous commit and got window close events working on Mac OS X. Woo!
Diffstat (limited to 'sysdata_darwin.go')
-rw-r--r--sysdata_darwin.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdata_darwin.go b/sysdata_darwin.go
index 9cbbee9..797fe70 100644
--- a/sysdata_darwin.go
+++ b/sysdata_darwin.go
@@ -65,12 +65,14 @@ var classTypes = [nctypes]*classData{
// we have to specify a content rect to start; it will be overridden soon though
win := objc_alloc(_NSWindow)
- return objc_msgSend_rect_uint_uint_bool(win,
+ win = objc_msgSend_rect_uint_uint_bool(win,
_initWithContentRect,
0, 0, 100, 100,
NSTitledWindowMask | NSClosableWindowMask | NSClosableWindowMask | NSResizableWindowMask,
2, // NSBackingStoreBuffered - the only backing store method that Apple says we should use (the others are legacy)
C.BOOL(C.YES)) // defer creation of device until we show the window
+ objc_setDelegate(win, appDelegate)
+ return win
},
show: func(what C.id) {
C.objc_msgSend_id(what, _makeKeyAndOrderFront, what)