summaryrefslogtreecommitdiff
path: root/redo/container_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'redo/container_unix.go')
-rw-r--r--redo/container_unix.go24
1 files changed, 14 insertions, 10 deletions
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