diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-27 15:21:47 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-27 15:21:47 -0400 |
| commit | bd44815a5480061b48106d209767e3ad6d724a13 (patch) | |
| tree | c3b779b4335cba07edf25bc76224ec2b44c8b3ad /tab_unix.go | |
| parent | f9699ff93851ef962e999beef0d7b93348afda5b (diff) | |
Migrated the GTK+ backend to the new new container system in which containers are no longer full controls but are still used to hold more than one control and handle the resizing entirely on their own.
Diffstat (limited to 'tab_unix.go')
| -rw-r--r-- | tab_unix.go | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/tab_unix.go b/tab_unix.go index 064f17f..5e77b17 100644 --- a/tab_unix.go +++ b/tab_unix.go @@ -18,8 +18,6 @@ type tab struct { tabs []*container children []Control - - chainresize func(x int, y int, width int, height int, d *sizing) } func newTab() Tab { @@ -29,8 +27,6 @@ func newTab() Tab { container: (*C.GtkContainer)(unsafe.Pointer(widget)), notebook: (*C.GtkNotebook)(unsafe.Pointer(widget)), } - t.chainresize = t.fresize - t.fresize = t.xresize // there are no scrolling arrows by default; add them in case there are too many tabs C.gtk_notebook_set_scrollable(t.notebook, C.TRUE) return t @@ -40,8 +36,9 @@ func (t *tab) Append(name string, control Control) { c := newContainer() t.tabs = append(t.tabs, c) // this calls gtk_container_add(), which, according to gregier in irc.gimp.net/#gtk+, acts just like gtk_notebook_append_page() - c.setParent(&controlParent{t.container}) + C.gtk_container_add(t.container, c.widget) control.setParent(c.parent()) + c.resize = control.resize t.children = append(t.children, control) cname := togstr(name) defer freegstr(cname) @@ -51,13 +48,4 @@ func (t *tab) Append(name string, control Control) { cname) } -func (t *tab) xresize(x int, y int, width int, height int, d *sizing) { - // first, chain up to change the GtkFrame and its child container - t.chainresize(x, y, width, height, d) - - // now that the containers have the correct size, we can resize the children - for i, _ := range t.tabs { - a := t.tabs[i].allocation(false/*TODO*/) - t.children[i].resize(int(a.x), int(a.y), int(a.width), int(a.height), d) - } -} +// no need to handle resize; the children containers handle that for us |
