I'm designing a GUI for android with kivy. There are many TextInput-fields, most of them need some kind of validation. What I've found so far is, that on_text_validate would allow for plausibility checks, but only if the user leaves that field with ENTER, which is rarely the case in an android-environment. How can I achieve checks if the user sets the focus to another widget by tapping? Doing this (allways) with on_text seems a bit weird to me, but maybe it's possible. A simple example: how would you make sure that the user is only able to insert integers and that the value is in a definite range? The other question I would like to ask: how is it possible to deactivate a TextInput depending on the value of previous inputs or to set the focus appropriately? I think these are standard tasks in GUI-programming and I'm a bit confused on how to manage these in kivy - help would be very appreciated!
Asked
Active
Viewed 2,242 times
1
-
I just discovered input_filter and TextInput.insert_text() in here: http://kivy.org/docs/api-kivy.uix.textinput.html - i must have overlooked these details before - it's pretty much there to read :) I'm going to play around with these feature and give feedback if it solves my problems ... – Orang Mutan Nov 01 '15 at 18:24
-
http://stackoverflow.com/questions/25296508/set-the-width-property-for-textinput gave me the crucial clue on how to use said property 'input_filter' – Orang Mutan Nov 01 '15 at 20:03