(Sorry if it is something very obvious, but I am very new to golang so maybe I miss something. )
package main
import (
"github.com/rivo/tview"
"github.com/gdamore/tcell"
)
func main() {
app := tview.NewApplication()
field := tview.NewInputField().SetDoneFunc(func (key tcell.Key) { app.Stop() })
//container := tview.NewForm().AddFormItem(field)
// OR
//container := tview.NewFlex().AddItem(field, 0, 1, true)
if err := app.SetRoot(container, true).SetFocus(field).Run(); err != nil {
panic(err)
}
}
In the code above, when I press Enter, the app stops only with the second container line (inside a Flex). If I use the first container (the Form) nothing is happening. Is this by design?
(Sorry if it is something very obvious, but I am very new to golang so maybe I miss something. )
In the code above, when I press Enter, the app stops only with the second container line (inside a Flex). If I use the first container (the Form) nothing is happening. Is this by design?