From 2a83b20ce34a14727de12b06cace6cc818cc8946 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Wed, 24 Jan 2018 21:48:53 +0100 Subject: [PATCH] Improved documentation. --- dropdown.go | 3 ++- form.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dropdown.go b/dropdown.go index a31c885..d3c24d1 100644 --- a/dropdown.go +++ b/dropdown.go @@ -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) diff --git a/form.go b/form.go index 2be11c5..10b416e 100644 --- a/form.go +++ b/form.go @@ -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).