Skip to content

Instantly share code, notes, and snippets.

@amalgamatedclyde
Created April 14, 2014 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalgamatedclyde/10679967 to your computer and use it in GitHub Desktop.
Save amalgamatedclyde/10679967 to your computer and use it in GitHub Desktop.
reproduce TextInput bug
__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