From 41f3ef292f2e0d70beb3722004c968881ca0fae2 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 25 Jul 2014 22:13:09 -0400 Subject: Cleaned up sizing a bit. Being able to know how big something will be ahead of time would be better. --- redo/containers_unix.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'redo/containers_unix.go') diff --git a/redo/containers_unix.go b/redo/containers_unix.go index 20d1bef..2bae60b 100644 --- a/redo/containers_unix.go +++ b/redo/containers_unix.go @@ -36,7 +36,7 @@ func (t *tab) Append(name string, control Control) { t.layoutcs = append(t.layoutcs, (*C.GtkContainer)(unsafe.Pointer(layout))) t.layouts = append(t.layouts, (*C.GtkLayout)(unsafe.Pointer(layout))) c := new(container) - c.beginResize = beginResize + // don't set beginResize; this container's resize() will be a recursive call t.containers = append(t.containers, c) c.child = control c.child.setParent((*C.GtkContainer)(unsafe.Pointer(layout))) @@ -55,6 +55,15 @@ func (t *tab) Append(name string, control Control) { } } +func (t *tab) allocate(x int, y int, width int, height int, d *sizing) []*allocation { + // set up the recursive calls + for _, c := range t.containers { + c.d = d + } + // and prepare the tabbed control itself + return t.widgetbase.allocate(x, y, width, height, d) +} + //export layoutResizing func layoutResizing(wid *C.GtkWidget, r *C.GdkRectangle, data C.gpointer) { c := (*container)(unsafe.Pointer(data)) -- cgit v1.2.3