Last active
August 29, 2015 13:56
-
-
Save brousch/8806515 to your computer and use it in GitHub Desktop.
Revisions
-
brousch revised this gist
Feb 4, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,10 +7,10 @@ <Test>: orientation: 'horizontal' if root.width > root.height else 'vertical' Button: text: "Button1\\n{}x{}".format(self.width, self.height) size_hint: (None, 1) if root.width > root.height else (1, None) Button: text: "Button2\\n{}x{}".format(self.width, self.height) size_hint: (0.75, 1) if root.width > root.height else (1, 0.75) """ -
brousch renamed this gist
Feb 4, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
brousch created this gist
Feb 4, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ from kivy.app import App from kivy.lang import Builder from kivy.uix.boxlayout import BoxLayout kv = """ <Test>: orientation: 'horizontal' if root.width > root.height else 'vertical' Button: text: "{}x{}".format(self.width, self.height) size_hint: (None, 1) if root.width > root.height else (1, None) Button: text: "{}x{}".format(self.width, self.height) size_hint: (0.75, 1) if root.width > root.height else (1, 0.75) """ Builder.load_string(kv) class Test(BoxLayout): def __init__(self, **kwargs): super(Test, self).__init__(**kwargs) class TestApp(App): def build(self): return Test() if __name__ == '__main__': TestApp().run()