Created
October 14, 2013 08:10
-
-
Save allan-simon/6972480 to your computer and use it in GitHub Desktop.
if you remove the `col` variable ,and add the buttonscatter directly like in https://gist.github.com/allan-simon/6972475 then it's going to take the full screen
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 characters
import kivy | |
kivy.require('1.1.3') | |
import random | |
from kivy.lang import Builder | |
from kivy.app import App | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.uix.button import Button | |
from kivy.uix.floatlayout import FloatLayout | |
from kivy.uix.scatter import Scatter | |
from kivy.uix.widget import Widget | |
Builder.load_string(''' | |
<Showcase>: | |
canvas: | |
Color: | |
rgb: 1, 1, 1 | |
Rectangle: | |
size: self.size | |
BoxLayout: | |
orientation: 'vertical' | |
<ButtonsScatter>: | |
scale_min: 1 | |
canvas: | |
Color: | |
rgba: .5, .5, .5, .2 | |
Rectangle: | |
size: self.size | |
BoxLayout: | |
size: root.size | |
padding: 40 | |
Button: | |
text: 'Hello' | |
Button: | |
text: 'World' | |
''') | |
class Showcase(FloatLayout): | |
pass | |
class ButtonsScatter(Scatter): | |
pass | |
class ShowcaseApp(App): | |
def on_pause(self): | |
return True | |
def build(self): | |
sc = Showcase() | |
col = Widget() | |
s = ButtonsScatter(size=(300, 200)) | |
col.add_widget(s) | |
sc.add_widget( | |
col | |
) | |
return sc | |
if __name__ == '__main__': | |
ShowcaseApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment