Created
March 5, 2013 22:12
-
-
Save KristerV/5094809 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
from kivy.lang import Builder | |
from kivy.app import App | |
from kivy.uix.button import Button | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.uix.gridlayout import GridLayout | |
from kivy.uix.scrollview import ScrollView | |
from kivy.uix.label import Label | |
from kivy.clock import Clock | |
class TestApp(App): | |
def set_scroll_y(self, instance, value): | |
self.parem_kast.scroll_y = value | |
def build(self): | |
self.box = BoxLayout() | |
# kanalid = BoxLayout() | |
self.vasak_kast = ScrollView(size_hint = (None,1), size_x=150) | |
self.parem_kast = ScrollView() | |
self.grid_vasak = GridLayout(size_hint = (1,3), cols=1) | |
self.grid_parem = GridLayout(size_hint = (1,3), cols=1) | |
self.box.add_widget(self.vasak_kast) | |
self.box.add_widget(self.parem_kast) | |
self.vasak_kast.add_widget(self.grid_vasak) | |
self.parem_kast.add_widget(self.grid_parem) | |
self.grid_vasak.add_widget(Label(text='Logod')) | |
self.grid_parem.add_widget(Label(text='Kanalid')) | |
self.vasak_kast.bind(scroll_y=self.set_scroll_y) | |
for i in range(20): | |
self.grid_parem.add_widget(Button(text='kanal %s'%i)) | |
for i in range(20): | |
self.grid_vasak.add_widget(Button(text='Pilt %s'%i)) | |
return self.box | |
if __name__ == '__main__': | |
TestApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment