summaryrefslogtreecommitdiff
path: root/redo/container_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-04 22:21:58 -0400
committerPietro Gagliardi <[email protected]>2014-08-04 22:21:58 -0400
commit515a605dda3b4054693cb31d9f4dae36a7e29720 (patch)
treef96f5d70ca2fc9a8531397fa13e936024a61373e /redo/container_unix.go
parentb84cdaf0772700162d1ad8e622a6095e90c5996b (diff)
Same as three commits ago, but for the GTK+ backend.
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