It is not clear on how to get the value of the functions used inside of a form using https://github.com/rivo/tview/.
package main
import (
"fmt"
"github.com/rivo/tview"
)
func main() {
app := tview.NewApplication()
form := tview.NewForm()
form.SetBorder(true).SetTitle("Enter some data").SetTitleAlign(tview.AlignLeft)
form.AddDropDown("Title", []string{"Mr.", "Ms.", "Mrs.", "Dr.", "Prof."}, 0, nil)
form.AddInputField("Value1", "", 0, nil, nil)
form.AddInputField("Value2", "", 0, nil, nil)
form.AddInputField("Value3", "", 0, nil, nil)
form.AddInputField("Value4", "", 0, nil, nil)
form.AddButton("OK", func() { app.Stop() })
if err := app.SetRoot(form, true).SetFocus(form).Run(); err != nil {
panic(err)
}
fmt.Printf("%s\n", form.GetFormItem(0).(*tview.DropDown))
}
Is it possible to convert the output of the dropdown to text?