Hi guys!
Is there a way to limit the input on a textfield to enter only numbers? I'm making a kind of number field with a textfield and two buttons (plus and minus) but I don't want the user enters letters in that textfield, I want only numbers.
Help me please!
Thanks :)
Answers
There is no library option to do this.
You have two user options
1) If the user is not going to type-in a number then use a GLabel instead. That way your program can make sure only numbers are used.
2) If the user IS going to type-in numbers then you can text the textfield contents on the GEvent.CHANGED action.
Although option 2 can be made to work although its messy.
Hi, thank for your help, but i found that when I convert any string different from numbers to int the value is equal to zero, so I played with that. :D Here is more or less what I did. I hope it helps.