Bring TextInput in line with all the other inputs

This commit is contained in:
Sasha Koshka 2024-08-15 13:17:43 -04:00
parent 080e4511f2
commit b3e7178176

View File

@ -31,15 +31,25 @@ func NewTextInput (text string) *TextInput {
return this
}
// SetText sets the text content of the input.
func (this *TextInput) SetText (text string) {
// SetValue sets the text content of the input.
func (this *TextInput) SetValue (text string) {
this.text = []rune(text)
this.TextBox.SetText(text)
}
// Value returns the text content of the input.
func (this *TextInput) Value () string {
return string(this.text)
}
// SetText sets the text content of the input.
func (this *TextInput) SetText (text string) {
this.SetValue(text)
}
// Text returns the text content of the input.
func (this *TextInput) Text () string {
return string(this.text)
return this.Value()
}
// OnConfirm specifies a function to be called when the user presses enter