diff --git a/_examples/dynamic.go b/_examples/dynamic.go index 962c198..01e6a1a 100644 --- a/_examples/dynamic.go +++ b/_examples/dynamic.go @@ -78,6 +78,12 @@ func initKeybindings(g *gocui.Gui) error { }); err != nil { return err } + if err := g.SetKeybinding("", gocui.KeyBackspace, gocui.ModNone, + func(g *gocui.Gui, v *gocui.View) error { + return delView(g) + }); err != nil { + return err + } if err := g.SetKeybinding("", gocui.KeyBackspace2, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { return delView(g) diff --git a/_examples/mouse.go b/_examples/mouse.go index b6c55ec..bc38e47 100644 --- a/_examples/mouse.go +++ b/_examples/mouse.go @@ -19,7 +19,7 @@ func main() { } defer g.Close() - g.Cursor = true + g.Cursor = false g.Mouse = true g.SetManagerFunc(layout) diff --git a/_examples/table.go b/_examples/table.go index a97f510..189680a 100644 --- a/_examples/table.go +++ b/_examples/table.go @@ -43,7 +43,7 @@ func (t *Table) Layout(g *gocui.Gui) error { width, height := view.Size() hOffset := 0 for cid, column := range t.Columns { - size := int(float32(width) * column.Size) + size := int(float32(width+1) * column.Size) view.SetWritePos(hOffset, 0) view.WriteString(column.Title) @@ -53,7 +53,7 @@ func (t *Table) Layout(g *gocui.Gui) error { view.SetWritePos(hOffset, rid+1) view.WriteString(t.Data[cid][rid]) } - view.SetWritePos(hOffset+size-3, rid) + view.SetWritePos(hOffset+size-1, rid) view.WriteRunes([]rune{'│'}) } @@ -70,7 +70,7 @@ func main() { } defer g.Close() - table := NewTable("t", 1, 2, 80, 10) + table := NewTable("t", 0, 2, 80, 10) table.Columns = []Column{ {"Column1", 0.25}, {"Column2", 0.25},