Figured out how to input data within views
This commit is contained in:
parent
faa95c2248
commit
8acdc82081
|
@ -22,6 +22,7 @@ func main() {
|
||||||
go counter()
|
go counter()
|
||||||
|
|
||||||
g.Mouse = true
|
g.Mouse = true
|
||||||
|
g.Cursor = true
|
||||||
|
|
||||||
if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {
|
if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {
|
||||||
log.Panicln(err)
|
log.Panicln(err)
|
||||||
|
@ -59,9 +60,13 @@ func layout(g *gocui.Gui) error {
|
||||||
if err != gocui.ErrUnknownView {
|
if err != gocui.ErrUnknownView {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for i := 0; i < 5; i++ {
|
if _, err := g.SetCurrentView("anotherone"); err != nil {
|
||||||
fmt.Fprintln(v, "Hola!")
|
return err
|
||||||
}
|
}
|
||||||
|
v.Title = "Editing"
|
||||||
|
v.Editable = true
|
||||||
|
v.Wrap = true
|
||||||
|
fmt.Fprintln(v, "Holaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!")
|
||||||
}
|
}
|
||||||
|
|
||||||
if v, err := g.SetView("WOW", maxX/2-20, maxY/2, maxX/2+20, maxY/2+5); err != nil {
|
if v, err := g.SetView("WOW", maxX/2-20, maxY/2, maxX/2+20, maxY/2+5); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue