diff options
| author | Pietro Gagliardi <[email protected]> | 2014-04-07 14:32:25 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-04-07 14:32:25 -0400 |
| commit | 3bf215ae4edb616c14c4525638cf54425d6e8f36 (patch) | |
| tree | 3c253a36643b8ab6891545c217d9af906efc3358 /delegate_darwin.go | |
| parent | 00acf74177e520c2f961fb478e7674d24c9077c9 (diff) | |
Split out the common resizing code into its own function so that it's all in one place. This will also affect what happens if I switch to DeferWindowPos() on Windows.
Diffstat (limited to 'delegate_darwin.go')
| -rw-r--r-- | delegate_darwin.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/delegate_darwin.go b/delegate_darwin.go index 53eb361..4c40d39 100644 --- a/delegate_darwin.go +++ b/delegate_darwin.go @@ -78,17 +78,8 @@ func appDelegate_windowDidResize(self C.id, sel C.SEL, notification C.id) { s := getSysData(win) wincv := C.objc_msgSend_noargs(win, _contentView) // we want the content view's size, not the window's; selector defined in sysdata_darwin.go r := C.objc_msgSend_stret_rect_noargs(wincv, _frame) - if s.resize != nil { - // winheight is used here because (0,0) is the bottom-left corner, not the top-left corner - s.resizes = s.resizes[0:0] // set len to 0 without changing cap - s.resize(0, 0, int(r.width), int(r.height), &s.resizes) - for _, s := range s.resizes { - err := s.sysData.setRect(s.x, s.y, s.width, s.height, int(r.height)) - if err != nil { - panic("child resize failed: " + err.Error()) - } - } - } + // winheight is used here because (0,0) is the bottom-left corner, not the top-left corner + s.doResize(0, 0, int(r.width), int(r.height), int(r.height)) C.objc_msgSend_noargs(win, _display) // redraw everything; TODO only if resize() was called? } |
