aboutsummaryrefslogtreecommitdiffstats
path: root/gui/widget/input.go
diff options
context:
space:
mode:
Diffstat (limited to 'gui/widget/input.go')
-rw-r--r--gui/widget/input.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/gui/widget/input.go b/gui/widget/input.go
index d4d6738..f6c1dbc 100644
--- a/gui/widget/input.go
+++ b/gui/widget/input.go
@@ -72,3 +72,15 @@ func inputDraw(str []byte, focused bool, r image.Rectangle) func(draw.Image) ima
return r
}
}
+
+func isDigit(r rune) bool {
+ return '0' <= r && r <= '9'
+}
+
+func atoi(s []byte) uint {
+ var n uint = 0
+ for _, d := range s {
+ n = n*10 + uint(d-'0')
+ }
+ return n
+}