Update NumberInput to use new TextInput methods

This commit is contained in:
Sasha Koshka 2024-08-25 01:32:44 -04:00
parent 2b354979aa
commit 82cf822602

View File

@ -75,13 +75,13 @@ func (this *NumberInput) Dot () text.Dot {
// Value returns the value of the input.
func (this *NumberInput) Value () float64 {
value, _ := strconv.ParseFloat(this.input.Text(), 64)
value, _ := strconv.ParseFloat(this.input.Value(), 64)
return value
}
// SetValue sets the value of the input.
func (this *NumberInput) SetValue (value float64) {
this.input.SetText(strconv.FormatFloat(value, 'g', -1, 64))
this.input.SetValue(strconv.FormatFloat(value, 'g', -1, 64))
}
// OnValueChange specifies a function to be called when the user edits the input