Last active
August 29, 2015 14:12
-
-
Save kived/5fe6bf4a82995654037a to your computer and use it in GitHub Desktop.
Kivy: TextInput focus selection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kivy | |
kivy.require('1.8.1') | |
from kivy.app import App | |
from kivy.lang import Builder | |
from kivy.clock import Clock | |
root = Builder.load_string(''' | |
#:import Clock kivy.clock.Clock | |
FloatLayout: | |
TextInput: | |
id: ti | |
size_hint: None, None | |
size: 100, 100 | |
pos: 100, 100 | |
text: 'asdgasg' | |
on_focused: self.focused and Clock.schedule_once(lambda dt: self.select_all()) | |
''') | |
class TestApp(App): | |
def build(self): | |
return root | |
if __name__ == '__main__': | |
TestApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment