diff options
| -rw-r--r-- | examples/layout/blinker.go | 7 | ||||
| -rwxr-xr-x | examples/layout/layout | bin | 0 -> 5564792 bytes | |||
| -rw-r--r-- | examples/layout/main.go | 2 | ||||
| -rw-r--r-- | layout/mux.go | 3 |
4 files changed, 4 insertions, 8 deletions
diff --git a/examples/layout/blinker.go b/examples/layout/blinker.go index b096a73..8c380c3 100644 --- a/examples/layout/blinker.go +++ b/examples/layout/blinker.go @@ -40,11 +40,8 @@ func Blinker(env gui.Env) { case win.MoDown: if event.Point.In(r) { go func() { - for i := 0; i < 3; i++ { - visible = false - env.Draw() <- redraw() - time.Sleep(time.Second / 3) - visible = true + for i := 0; i < 6; i++ { + visible = !visible env.Draw() <- redraw() time.Sleep(time.Second / 3) } diff --git a/examples/layout/layout b/examples/layout/layout Binary files differnew file mode 100755 index 0000000..0d51021 --- /dev/null +++ b/examples/layout/layout diff --git a/examples/layout/main.go b/examples/layout/main.go index c0055ee..c672e63 100644 --- a/examples/layout/main.go +++ b/examples/layout/main.go @@ -97,7 +97,7 @@ func run() { go Blinker(b1) go Blinker(b2) box := layout.Box{ - Length: 4, + Length: 3, Vertical: true, Gap: 4, Background: colornames.Pink, diff --git a/layout/mux.go b/layout/mux.go index 2789878..d56d266 100644 --- a/layout/mux.go +++ b/layout/mux.go @@ -62,6 +62,7 @@ func NewMux(env gui.Env, envs []*gui.Env, l Layout) (mux *Mux, master gui.Env) { mux.mu.Lock() if resize, ok := e.(gui.Resize); ok { mux.lastResize = resize + rect := resize.Rectangle lay := mux.layout.Lay(rect) if len(lay) != len(mux.eventsIns) { log.Printf("Lay of %T has %d elements while mux has %d, skipping\n", l, len(lay), len(envs)) @@ -69,8 +70,6 @@ func NewMux(env gui.Env, envs []*gui.Env, l Layout) (mux *Mux, master gui.Env) { continue } - rect := resize.Rectangle - // Redraw self mux.draw <- func(drw draw.Image) image.Rectangle { mux.layout.Redraw(drw, rect) |