Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Kivy App.
- """
- import kivy
- kivy.require('1.10.0')
- from kivy.app import App
- from kivy.lang import Builder
- from kivy.uix.actionbar import ActionItem
- from kivy.uix.textinput import TextInput
- KV = '''\
- ActionBar:
- ActionView:
- ActionPrevious:
- ActionButton:
- text: "This Button doesn't do anything"
- '''
- class ActionText(TextInput, ActionItem):
- def __init__(self, **kwargs):
- super(ActionText, self).__init__(**kwargs)
- self.multiline = False
- def on_text_validate(self, *args):
- print("Searching for " + self.text)
- class MyApp(App):
- def build(self):
- root = Builder.load_string(KV)
- root.action_view.add_widget(ActionText())
- return root
- if __name__ == '__main__':
- MyApp().run()
Add Comment
Please, Sign In to add comment