summaryrefslogtreecommitdiff
path: root/sysdata_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-01 13:58:38 -0500
committerPietro Gagliardi <[email protected]>2014-03-01 13:58:38 -0500
commit00243442d2ed438e1e581b00aae369a2eb9836d9 (patch)
tree8b5bd359bed91685764b330db9314f3fdeb5f6da /sysdata_darwin.go
parent0770c2a6973e94b64e2a0cb8327f76acd23af799 (diff)
Fixed Mac OS X sysData.setWindowSize() to get the window origin. Now to fix the rest of the errors...
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 3456580..c50eeed 100644
--- a/sysdata_darwin.go
+++ b/sysdata_darwin.go
@@ -38,6 +38,7 @@ var (
_title = sel_getUid("title")
_stringValue = sel_getUid("stringValue")
// TODO others
+ _frame = sel_getUid("_frame")
_setFrameDisplay = sel_getUid("setFrame:display:")
)
@@ -219,8 +220,9 @@ func (s *sysData) setWindowSize(width int, height int) error {
defer close(ret)
uitask <- func() {
// we need to get the top left point
+ r := C.objc_msgSend_stret_rect_noargs(s.id, _frame)
objc_msgSend_rect_bool(s.id, _setFrameDisplay,
- x, y, width, height,
+ int(r.x), int(r.y), width, height,
C.BOOL(C.YES)) // TODO set to NO to prevent subviews from being redrawn before they are resized?
ret <- struct{}{}
}