Hi
I am battling to get this right. I have a flex grid on the screen and am asking them to make a choice. So, in essence
I create a flex and in it, put a dropdown.
Based on the dropdown answer, I want to ask a different question, but want to simply add the next question to the flex.
eg. Kind of like below, so when a selection is made on the ssdropdown, I want to add the ltdropdown to the flexgrid. I have used app.Draw() to try refresh the screen, but the ltdropdown never appears on the screen
func a() {
app := tview.NewApplication()
flex := tview.NewFlex()
ssdropdown := tview.NewDropDown().
SetLabel("Select from the available source systems: (hit Enter): ").
SetOptions(strings.Split("Syspro,Pastel", ","), nil)
ssdropdown.SetSelectedFunc(func(text string, index int) {
ltdropdown := tview.NewDropDown().
SetLabel("Will this be a live or test system? (hit Enter): ").
SetOptions([]string{"TEST", "QA", "LIVE"}, nil)
flex.AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
AddItem(ltdropdown, 1, 0, true),
1, 0, false)
app.Draw()
})
if err := app.SetRoot(flex, true).SetFocus(ssdropdown).Run(); err != nil {
panic(err)
}
}
Hi
I am battling to get this right. I have a flex grid on the screen and am asking them to make a choice. So, in essence
I create a flex and in it, put a dropdown.
Based on the dropdown answer, I want to ask a different question, but want to simply add the next question to the flex.
eg. Kind of like below, so when a selection is made on the ssdropdown, I want to add the ltdropdown to the flexgrid. I have used app.Draw() to try refresh the screen, but the ltdropdown never appears on the screen