Created
July 30, 2015 17:45
-
-
Save Alan-FGR/264b9d1ea3a747f8fd92 to your computer and use it in GitHub Desktop.
This file contains 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
__author__ = 'Alan' | |
__version__ = '0.1' | |
import kivy | |
kivy.require("1.0.0") | |
from kivy.app import Builder | |
from kivy.app import App | |
from kivy.uix.gridlayout import GridLayout | |
from kivy.uix.scrollview import ScrollView | |
mybutstr = """ | |
Button: | |
text_size: self.width-dp(20), None | |
size_hint_y: None | |
height: self.texture_size[1]+dp(20) | |
""" | |
class MyApp(App): | |
def build(self, **kwargs): | |
scr = ScrollView() | |
mainlo = GridLayout(cols = 2, size_hint_y = None) | |
mainlo.bind(minimum_height = mainlo.setter("height")) | |
scr.add_widget(mainlo) | |
leftlo = GridLayout(cols=1, size_hint_y = None) | |
leftlo.bind(minimum_height = leftlo.setter("height")) | |
mainlo.add_widget(leftlo) | |
rightlo = GridLayout(cols=1, size_hint_y = None) | |
mainlo.add_widget(rightlo) | |
for i in range(20): | |
newb = Builder.load_string(mybutstr) | |
newb.text = (str(i)+' ')*(1+i*2) | |
leftlo.add_widget(newb) | |
return scr | |
MyApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fix (thanks to Kived):