MCPcopy Create free account
hub / github.com/Macmod/godap / AddInputField

Method AddInputField

tui/theme.go:128–141  ·  view source on GitHub ↗
(label, value string, fieldWidth int, accept func(textToCheck string, lastChar rune) bool, changed func(text string))

Source from the content-addressed store, hash-verified

126}
127
128func (f *XForm) AddInputField(label, value string, fieldWidth int, accept func(textToCheck string, lastChar rune) bool, changed func(text string)) *XForm {
129 inputField := tview.NewInputField()
130 f.AddFormItem(inputField.
131 SetFieldStyle(tcell.StyleDefault.Background(tcell.ColorWhite).Foreground(tcell.ColorBlack)).
132 SetPlaceholderStyle(DefaultTheme.PlaceholderStyle).
133 SetPlaceholderTextColor(DefaultTheme.PlaceholderTextColor).
134 SetLabel(label).
135 SetText(value).
136 SetFieldWidth(fieldWidth).
137 SetAcceptanceFunc(accept).
138 SetChangedFunc(changed))
139
140 return f
141}
142
143func (f *XForm) AddTextArea(label string, text string, fieldWidth, fieldHeight int, maxLength int, changed func(text string)) *XForm {
144 if fieldHeight == 0 {

Callers 10

openConfigFormFunction · 0.95
loadAceEditorFormFunction · 0.80
handleAttrsKeyCtrlEFunction · 0.80
handleAttrsKeyCtrlNFunction · 0.80
openCreateZoneFormFunction · 0.80
openActionNodeFormFunction · 0.80
loadChangeOwnerFormFunction · 0.80
openCreateObjectFormFunction · 0.80
openAddMemberToGroupFormFunction · 0.80
openMoveObjectFormFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected