It's not at all obvious to me how to get the value the user inputs for the Name input field, in below simple snippet.
package main
import (
"fmt"
"github.com/rivo/tview"
)
func main() {
app := tview.NewApplication()
form := tview.NewForm()
form.SetTitle(" My Form ")
form.AddInputField("Name", "", 20, nil, nil)
form.AddButton("OK", func() { app.Stop() })
if err := app.SetRoot(form, true).SetFocus(form).Run(); err != nil {
panic(err)
}
fmt.Printf("%s
", form.GetFormItem(0))
}