Documentation
¶
Index ¶
- Constants
- func EmptyBoxSpace(bgColor tcell.Color) *tview.Box
- type Form
- func (f *Form) AddButton(label string, selected func()) *Form
- func (f *Form) AddCheckbox(label string, checked bool, changed func(checked bool)) *Form
- func (f *Form) AddInputField(label, value string, fieldWidth int, ...) *Form
- func (f *Form) Draw(screen tcell.Screen)
- func (f *Form) Focus(delegate func(p tview.Primitive))
- func (f *Form) HasFocus() bool
- func (f *Form) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (f *Form) SetCancelFunc(handler func()) *Form
- func (f *Form) SetRect(x, y, width, height int)
Constants ¶
View Source
const ( // DialogPadding dialog inner padding. DialogPadding = 3 // DialogHelpHeight dialog help text height. DialogHelpHeight = 1 // DialogMinWidth dialog min width. DialogMinWidth = 40 // FormHeightOffset form height offset for border. FormHeightOffset = 3 )
Variables ¶
This section is empty.
Functions ¶
func EmptyBoxSpace ¶
EmptyBoxSpace creates an empty box with the specified background color.
Types ¶
type Form ¶
Form is a modal form component with a title, form fields, and help text.
func (*Form) AddCheckbox ¶
AddCheckbox adds a checkbox to the form.
func (*Form) AddInputField ¶
func (f *Form) AddInputField(label, value string, fieldWidth int, accept func(textToCheck string, lastChar rune) bool, changed func(text string)) *Form
AddInputField adds an input field to the form.
func (*Form) InputHandler ¶
InputHandler returns the handler for this primitive.
func (*Form) SetCancelFunc ¶
SetCancelFunc sets the function to be called when the form is cancelled.
Click to show internal directories.
Click to hide internal directories.