Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from kivy.base import runTouchApp
- from kivy.lang import Builder
- from kivy.uix.scrollview import ScrollView
- from kivy.app import App
- import random
- from kivy.uix.button import Button
- from kivy.garden.roulette import Roulette
- from kivy.garden.tickline import Tickline
- Builder.load_string("""
- #:import random random
- #:import Roulette kivy.garden.roulette
- <NewThing>:
- BoxLayout:
- Button:
- text: 'sample testing'
- background_color: [random.random(),random.random(),random.random(),.6]
- Roulette
- Label:
- text: 'product text'
- <ScrollableLabel>:
- BoxLayout:
- orientation: 'vertical'
- BoxLayout:
- orientation: 'horizontal'
- ClickMe:
- text: 'add more!'
- on_release: self.click(root)
- NewThing
- NewThing
- """)
- productlist = ['apple','2']
- class ClickMe(Button):
- def __init__(self, **kwargs):
- super(ClickMe, self).__init__(**kwargs)
- def click(self, rootwidget):
- # rootwidget.add_widget(NewThing())
- print self.parent.parent.add_widget(NewThing())
- class NewThing(ScrollView):
- def __init__(self, **kwargs):
- super(NewThing, self).__init__(**kwargs)
- pass
- class ScrollableLabel(ScrollView):
- def __init__(self, **kwargs):
- super(ScrollableLabel, self).__init__(**kwargs)
- runTouchApp(ScrollableLabel())
Advertisement
Add Comment
Please, Sign In to add comment