aboutsummaryrefslogtreecommitdiffstats
path: root/layout/box.go
diff options
context:
space:
mode:
authorClement Benard <contact@clementbenard.com>2019-07-09 15:31:32 +0200
committerClement Benard <contact@clementbenard.com>2019-07-09 15:31:32 +0200
commit1415586e633ee33194442f131a5a691f889c8ee5 (patch)
tree2412330aa96236d292fd48a2b80926e1a5fac19c /layout/box.go
parent1223e277009005337243ca991cb54dd75bf723a7 (diff)
downloadgui-1415586e633ee33194442f131a5a691f889c8ee5.zip
better Mux and Env handling in layout
Diffstat (limited to 'layout/box.go')
-rw-r--r--layout/box.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/layout/box.go b/layout/box.go
index 568ac58..4e16a76 100644
--- a/layout/box.go
+++ b/layout/box.go
@@ -33,7 +33,7 @@ type Box struct {
vertical bool
}
-func NewBox(env gui.Env, contents []*gui.Env, options ...func(*Box)) {
+func NewBox(env gui.Env, contents []*gui.Env, options ...func(*Box)) gui.Env {
ret := &Box{
Background: image.Black,
Contents: contents,
@@ -43,10 +43,11 @@ func NewBox(env gui.Env, contents []*gui.Env, options ...func(*Box)) {
f(ret)
}
- mux := NewMux(env, ret)
+ mux, env := NewMux(env, ret)
for _, item := range contents {
- *item, _ = mux.makeEnv(false)
+ *item = mux.MakeEnv()
}
+ return env
}
func BoxVertical(b *Box) {