summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-14 16:32:45 -0400
committerPietro Gagliardi <[email protected]>2014-07-14 16:32:45 -0400
commitdaafb7aef88908229c2039566e832333c111a95c (patch)
treed9736007731a7705a2eabb6fb68047afd4418c46
parent0e7589af4718d8f90bbc007306c75c2a39386d2f (diff)
Added the widget container to the GTK+ code.
-rw-r--r--redo/window_unix.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/redo/window_unix.go b/redo/window_unix.go
index 85b8e93..8c0f55e 100644
--- a/redo/window_unix.go
+++ b/redo/window_unix.go
@@ -18,6 +18,9 @@ type window struct {
bin *C.GtkBin
window *C.GtkWindow
+ layoutc *C.GtkContainer
+ layout *C.GtkLayout
+
closing *event
}
@@ -28,11 +31,14 @@ func newWindow(title string, width int, height int) *Request {
widget := C.gtk_window_new(C.GTK_WINDOW_TOPLEVEL)
ctitle := togstr(title)
defer freegstr(ctitle)
+ layoutw := C.gtk_layout_new(nil, nil)
w := &window{
widget: widget,
container: (*C.GtkContainer)(unsafe.Pointer(widget)),
bin: (*C.GtkBin)(unsafe.Pointer(widget)),
window: (*C.GtkWindow)(unsafe.Pointer(widget)),
+ layoutc: (*C.GtkContainer)(unsafe.Pointer(layoutw)),
+ layout: (*C.GtkLayout)(unsafe.Pointer(layoutw)),
closing: newEvent(),
}
C.gtk_window_set_title(w.window, ctitle)
@@ -42,7 +48,7 @@ func newWindow(title string, width int, height int) *Request {
C.GCallback(C.windowClosing),
C.gpointer(unsafe.Pointer(w)))
// TODO size
- // TODO content
+ C.gtk_container_add(w.container, layoutw)
c <- w
},
resp: c,