diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-05-12 17:19:49 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-05-12 17:19:49 -0400 |
| commit | 0f90df6e1acbd2e3d085438c3a4851b6297dcd34 (patch) | |
| tree | 1f3890454cbf3b0e52488707d4e7fc7b40eaf203 /gui/widget/input.go | |
| parent | 9dd70a042702b26b17086a4cf5bf478f34529c9c (diff) | |
| download | volute-faiface.zip | |
remove unnecessary loop labelsfaiface
Diffstat (limited to 'gui/widget/input.go')
| -rw-r--r-- | gui/widget/input.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gui/widget/input.go b/gui/widget/input.go index 1e15da9..7d5f809 100644 --- a/gui/widget/input.go +++ b/gui/widget/input.go @@ -18,25 +18,24 @@ func Input(val chan<- uint, r image.Rectangle, focus FocusSlave, env gui.Env, wg text := "0" focused := false env.Draw() <- inputDraw(text, focused, r) -Loop: for { select { case _, ok := <-focus.gain: if !ok { - break Loop + return } focused = true env.Draw() <- inputDraw(text, focused, r) case dir, ok := <-focus.lose: if !ok { - break Loop + return } focus.yield <- dir focused = false env.Draw() <- inputDraw(text, focused, r) case event, ok := <-env.Events(): if !ok { - break Loop + return } switch event := event.(type) { case win.WiFocus: |