From 515a605dda3b4054693cb31d9f4dae36a7e29720 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 4 Aug 2014 22:21:58 -0400 Subject: Same as three commits ago, but for the GTK+ backend. --- redo/container_unix.go | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'redo/container_unix.go') diff --git a/redo/container_unix.go b/redo/container_unix.go index 964df5a..1b48fba 100644 --- a/redo/container_unix.go +++ b/redo/container_unix.go @@ -20,6 +20,16 @@ type container struct { layout *C.GtkLayout } +type sizing struct { + sizingbase + + // for size calculations + // gtk+ needs nothing + + // for the actual resizing + shouldVAlignTop bool +} + func newContainer(child Control) *container { widget := C.gtk_layout_new(nil, nil) c := &container{ @@ -41,6 +51,10 @@ func newContainer(child Control) *container { return c } +func (c *container) setParent(p *controlParent) { + C.gtk_container_add(p.c, c.layoutwidget) +} + //export containerResizing func containerResizing(wid *C.GtkWidget, r *C.GdkRectangle, data C.gpointer) { c := (*container)(unsafe.Pointer(data)) @@ -49,16 +63,6 @@ func containerResizing(wid *C.GtkWidget, r *C.GdkRectangle, data C.gpointer) { fmt.Printf("new size %d x %d\n", r.width, r.height) } -type sizing struct { - sizingbase - - // for size calculations - // gtk+ needs nothing - - // for the actual resizing - shouldVAlignTop bool -} - const ( gtkXMargin = 12 gtkYMargin = 12 -- cgit v1.2.3