diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-04 20:04:16 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-04 20:04:16 -0400 |
| commit | ef513c433732f3a12f2d83417b9b1fb92d152930 (patch) | |
| tree | 38fce59bea3461b2122a2ee32a5499eb94f7cd23 /redo/tab_windows.go | |
| parent | 9ed4ec52597e03b080331efeac526322b669e565 (diff) | |
Completed the migration of the Windows backend to the new container system.
Diffstat (limited to 'redo/tab_windows.go')
| -rw-r--r-- | redo/tab_windows.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/redo/tab_windows.go b/redo/tab_windows.go index 8e96871..3456502 100644 --- a/redo/tab_windows.go +++ b/redo/tab_windows.go @@ -20,7 +20,7 @@ TODO type tab struct { _hwnd C.HWND - tabs []*layout + tabs []*container parent *controlParent } @@ -37,14 +37,14 @@ func newTab() Tab { } func (t *tab) Append(name string, control Control) { - l := newLayout("", 0, 0, C.TRUE, control) - t.tabs = append(t.tabs, l) + c := newContainer(control) + t.tabs = append(t.tabs, c) if t.parent != nil { - l.setParent(t.parent) + c.setParent(t.parent) } // initially hide tab 1..n controls; if we don't, they'll appear over other tabs, resulting in weird behavior if len(t.tabs) != 1 { - // TODO move these calls to layout itself + // TODO move these calls to container itself C.ShowWindow(t.tabs[len(t.tabs) - 1].hwnd, C.SW_HIDE) } C.tabAppend(t._hwnd, toUTF16(name)) @@ -68,8 +68,8 @@ func (t *tab) hwnd() C.HWND { func (t *tab) setParent(p *controlParent) { basesetParent(t, p) - for _, l := range t.tabs { - l.setParent(p) + for _, c := range t.tabs { + c.setParent(p) } t.parent = p } @@ -104,11 +104,11 @@ func (t *tab) commitResize(c *allocation, d *sizing) { C.tabGetContentRect(t._hwnd, &r) // and resize tabs // don't resize just the current tab; resize all tabs! - for _, l := range t.tabs { + for _, c := range t.tabs { // because each widget is actually a child of the Window, the origin is the one we calculated above // we use moveWindow() rather than calling resize() directly // TODO - C.moveWindow(l.hwnd, C.int(r.left), C.int(r.top), C.int(r.right - r.left), C.int(r.bottom - r.top)) + C.moveWindow(c.hwnd, C.int(r.left), C.int(r.top), C.int(r.right - r.left), C.int(r.bottom - r.top)) } // and now resize the tab control itself basecommitResize(t, c, d) |
