Created
April 14, 2014 20:22
-
-
Save amalgamatedclyde/10679967 to your computer and use it in GitHub Desktop.
reproduce TextInput bug
This file contains hidden or 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
__version__ = '0.9.0' | |
import kivy | |
from kivy.uix.textinput import TextInput | |
from kivy.app import App | |
class AutoComplete(TextInput): | |
def __init__(self, **kwargs): | |
super(AutoComplete, self).__init__(**kwargs) | |
self.current_cursor = (0,0) | |
self.char_buffer = '' | |
def insert_text(self, substring, from_undo=False): | |
super(AutoComplete, self).insert_text(substring + 'P') | |
print 'TEXT IS: ', self.text, 'SUBSTRING IS: ', substring | |
return True | |
class TextInputApp(App): | |
def __init__(self, **kwargs): | |
super(TextInputApp, self).__init__(**kwargs) | |
def build(self): | |
return AutoComplete() | |
if __name__ == "__main__": | |
TextInputApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment