android - qpython kivy textinput and display -
using qpython , kivy on android phone, i'm trying write program inputs text, processes , shows output.
from kivy.app import app kivy.uix.button import button kivy.uix.textinput import textinput class testapp(app): def build(self) r = textinput(multiline=false).text y = self.dosomething(r) return button(text = y) def dosomething(self, x): y = x + ' something' return y testapp().run
this fails - when push run doesn't ask input , display 'something'.
how fix can text input user?
edit replace build with:
def build(self): def cb(instance, value): print(value) r = textinput(focus=true, multiline=false) r.bind(text=cb) return r
Comments
Post a Comment