Bring TextInput in line with all the other inputs
This commit is contained in:
parent
080e4511f2
commit
b3e7178176
16
textinput.go
16
textinput.go
@ -31,15 +31,25 @@ func NewTextInput (text string) *TextInput {
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetText sets the text content of the input.
|
// SetValue sets the text content of the input.
|
||||||
func (this *TextInput) SetText (text string) {
|
func (this *TextInput) SetValue (text string) {
|
||||||
this.text = []rune(text)
|
this.text = []rune(text)
|
||||||
this.TextBox.SetText(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.
|
// Text returns the text content of the input.
|
||||||
func (this *TextInput) Text () string {
|
func (this *TextInput) Text () string {
|
||||||
return string(this.text)
|
return this.Value()
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnConfirm specifies a function to be called when the user presses enter
|
// OnConfirm specifies a function to be called when the user presses enter
|
||||||
|
Loading…
Reference in New Issue
Block a user