From 8f1165e0c7246a1faec655088004cce8c5e047d7 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 17 Oct 2014 20:02:34 -0400 Subject: Did most of the GTK+ migration. --- newctrl/container_unix.go | 57 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 newctrl/container_unix.go (limited to 'newctrl/container_unix.go') diff --git a/newctrl/container_unix.go b/newctrl/container_unix.go new file mode 100644 index 0000000..3f4d949 --- /dev/null +++ b/newctrl/container_unix.go @@ -0,0 +1,57 @@ +// +build !windows,!darwin + +// 23 february 2014 + +package ui + +import ( + "unsafe" +) + +// #include "gtk_unix.h" +import "C" + +type container struct { + *controlSingleWidget + container *C.GtkContainer +} + +type sizing struct { + sizingbase + + // for size calculations + // gtk+ needs nothing + + // for the actual resizing + // gtk+ needs nothing +} + +func newContainer() *container { + c := new(container) + c.controlSingleWidget = newControlSingleWidget(C.newContainer(unsafe.Pointer(c))) + c.container = (*C.GtkContainer)(unsafe.Pointer(c.widget)) + return c +} + +func (c *container) parent() *controlParent { + return &controlParent{c.container} +} + +const ( + gtkXMargin = 12 + gtkYMargin = 12 + gtkXPadding = 12 + gtkYPadding = 6 +) + +func (w *window) beginResize() (d *sizing) { + d = new(sizing) + if spaced { + d.xmargin = gtkXMargin + d.ymargintop = gtkYMargin + d.ymarginbottom = d.ymargintop + d.xpadding = gtkXPadding + d.ypadding = gtkYPadding + } + return d +} -- cgit v1.2.3