diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-18 19:36:29 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-18 19:36:29 -0400 |
| commit | 847690bb105ead7d68cb0af018fa96864ffe137d (patch) | |
| tree | 51d823171b211891276089e883e023df21fcc97c /redo/sizing_unix.go | |
| parent | 58673a614c1142567acae06e0830943bf6b50f11 (diff) | |
Fixed window resizing in GTK+ acting wonky AND several related TODOs to boot!
Diffstat (limited to 'redo/sizing_unix.go')
| -rw-r--r-- | redo/sizing_unix.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/redo/sizing_unix.go b/redo/sizing_unix.go index 83411dc..caa9c8c 100644 --- a/redo/sizing_unix.go +++ b/redo/sizing_unix.go @@ -66,9 +66,19 @@ func (w *widgetbase) commitResize(c *allocation, d *sizing) { } } */ - // TODO this uses w.parentw directly; change? - C.gtk_layout_move(w.parentw.layout, w.widget, C.gint(c.x), C.gint(c.y)) - C.gtk_widget_set_size_request(w.widget, C.gint(c.width), C.gint(c.height)) + + // as we resize on size-allocate, we have to also use size-allocate on our children + // this is fine anyway; in fact, this allows us to move without knowing what the container is! + // this is what GtkBox does anyway + // thanks to tristan in irc.gimp.net/#gtk+ + + var r C.GtkAllocation + + r.x = C.int(c.x) + r.y = C.int(c.y) + r.width = C.int(c.width) + r.height = C.int(c.height) + C.gtk_widget_size_allocate(w.widget, &r) } func (w *widgetbase) getAuxResizeInfo(d *sizing) { |
