1 // Demo code for the DropDown primitive. 2 package main 3 4 import "github.com/rivo/tview" 5 6 func main() { 7 app := tview.NewApplication() 8 dropdown := tview.NewDropDown(). 9 SetLabel("Select an option (hit Enter): "). 10 SetOptions([]string{"First", "Second", "Third", "Fourth", "Fifth"}, nil) 11 if err := app.SetRoot(dropdown, true).EnableMouse(true).Run(); err != nil { 12 panic(err) 13 } 14 } 15