From bd44815a5480061b48106d209767e3ad6d724a13 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 27 Oct 2014 15:21:47 -0400 Subject: 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. --- group_unix.go | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'group_unix.go') diff --git a/group_unix.go b/group_unix.go index 681ec75..054c170 100644 --- a/group_unix.go +++ b/group_unix.go @@ -18,10 +18,6 @@ type group struct { child Control container *container - - margined bool - - chainresize func(x int, y int, width int, height int, d *sizing) } func newGroup(text string, control Control) Group { @@ -54,10 +50,8 @@ func newGroup(text string, control Control) Group { g.container = newContainer() g.child.setParent(g.container.parent()) - g.container.setParent(&controlParent{g.gcontainer}) - - g.chainresize = g.fresize - g.fresize = g.xresize + g.container.resize = g.child.resize + C.gtk_container_add(g.gcontainer, g.container.widget) return g } @@ -73,18 +67,11 @@ func (g *group) SetText(text string) { } func (g *group) Margined() bool { - return g.margined + return g.container.margined } func (g *group) SetMargined(margined bool) { - g.margined = margined + g.container.margined = margined } -func (g *group) xresize(x int, y int, width int, height int, d *sizing) { - // first, chain up to change the GtkFrame and its child container - g.chainresize(x, y, width, height, d) - - // now that the container has the correct size, we can resize the child - a := g.container.allocation(g.margined) - g.child.resize(int(a.x), int(a.y), int(a.width), int(a.height), d) -} +// no need to override resize; the child container handles that for us -- cgit v1.2.3