andlabs / ui

Platform-native GUI library for Go.
Other
8.33k stars 651 forks source link

Get Float64 value in SpinBox #312

Closed s0kil closed 5 years ago

s0kil commented 5 years ago

What is the best way to get a float64 value? I have tried using SpinBox.

andlabs commented 5 years ago

Spinbox currently does not support float64, only int (this is a platform restriction). You can use a normal text box with package strconv in the interim.

s0kil commented 5 years ago

Thanks for the pointer. billAmount, _ = strconv.ParseFloat(billAmountEntry.Text(), 64)

andlabs commented 5 years ago

You shouldn't be ignoring errors from strconv. Package ui does need better validation primitives, though... (That's in the backlog.)