From 962a84e056fd524ed458391961510a1c32892895 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 3 Mar 2014 17:44:03 -0500 Subject: Fixed Mac OS X control placement flipping. This is done by passing the height of the window around setRect() calls to avoid polling the content view frame each time. --- sysdata_unix.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sysdata_unix.go') diff --git a/sysdata_unix.go b/sysdata_unix.go index f309729..fbfbf80 100644 --- a/sysdata_unix.go +++ b/sysdata_unix.go @@ -45,7 +45,8 @@ var classTypes = [nctypes]*classData{ return func() bool { if s.container != nil && s.resize != nil { // wait for init width, height := gtk_window_get_size(s.widget) - err := s.resize(0, 0, width, height) + // top-left is (0,0) so no need for winheight + err := s.resize(0, 0, width, height, 0) if err != nil { panic("child resize failed: " + err.Error()) } @@ -189,7 +190,7 @@ func (s *sysData) setText(text string) error { return nil } -func (s *sysData) setRect(x int, y int, width int, height int) error { +func (s *sysData) setRect(x int, y int, width int, height int, winheight int) error { gtk_fixed_move(s.container, s.widget, x, y) gtk_widget_set_size_request(s.widget, width, height) return nil -- cgit v1.2.3