Skip to content

Instantly share code, notes, and snippets.

@tshirtman
Created December 18, 2018 07:22
Show Gist options
  • Save tshirtman/0ad21aaee7b669bda016898b2a40c382 to your computer and use it in GitHub Desktop.
Save tshirtman/0ad21aaee7b669bda016898b2a40c382 to your computer and use it in GitHub Desktop.
from kivy.factory import Factory as F
from kivy.app import App
from kivy.lang import Builder
KV = '''
<ButtonLayout>:
on_press: print("here or there")
Label:
text: 'here'
Label:
text: 'there'
FloatLayout:
ButtonLayout:
size_hint: None, None
size: 200, 200
pos_hint: {'center': (.5, .5)}
'''
class ButtonLayout(F.ButtonBehavior, F.BoxLayout):
pass
class TestApp(App):
def build(self):
return Builder.load_string(KV)
if __name__ == '__main__':
TestApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment