mirror of https://github.com/jroimartin/gocui.git
_examples/widgets.go: Minor refactoring
This commit is contained in:
parent
e5517b913e
commit
89ecdb537d
|
@ -73,10 +73,8 @@ func (w *StatusbarWidget) Val() float32 {
|
||||||
|
|
||||||
func (w *StatusbarWidget) Layout(g *gocui.Gui) error {
|
func (w *StatusbarWidget) Layout(g *gocui.Gui) error {
|
||||||
v, err := g.SetView(w.name, w.x, w.y, w.x+w.w, w.y+2)
|
v, err := g.SetView(w.name, w.x, w.y, w.x+w.w, w.y+2)
|
||||||
if err != nil {
|
if err != nil && err != gocui.ErrUnknownView {
|
||||||
if err != gocui.ErrUnknownView {
|
return err
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
v.Clear()
|
v.Clear()
|
||||||
val := int(w.val * float32(w.w-1))
|
val := int(w.val * float32(w.w-1))
|
||||||
|
|
Loading…
Reference in New Issue