Improved documentation.

This commit is contained in:
Oliver 2018-01-24 21:48:53 +01:00
parent 03571f15bb
commit 2a83b20ce3
2 changed files with 4 additions and 2 deletions

View File

@ -74,7 +74,8 @@ func NewDropDown() *DropDown {
return d
}
// SetCurrentOption sets the index of the currently selected option.
// SetCurrentOption sets the index of the currently selected option. This may
// be a negative value to indicate that no option is currently selected.
func (d *DropDown) SetCurrentOption(index int) *DropDown {
d.currentOption = index
d.list.SetCurrentItem(index)

View File

@ -192,7 +192,8 @@ func (f *Form) AddPasswordField(label, value string, fieldWidth int, mask rune,
// AddDropDown adds a drop-down element to the form. It has a label, options,
// and an (optional) callback function which is invoked when an option was
// selected.
// selected. The initial option may be a negative value to indicate that no
// option is currently selected.
func (f *Form) AddDropDown(label string, options []string, initialOption int, selected func(option string, optionIndex int)) *Form {
f.items = append(f.items, NewDropDown().
SetLabel(label).