Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import kivy
- from kivy.app import App
- from kivy.uix.label import Label
- from kivy.lang import Builder
- from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
- from kivy.uix.floatlayout import FloatLayout
- from kivy.uix.boxlayout import BoxLayout
- from kivy.uix.anchorlayout import AnchorLayout
- from kivy.uix.gridlayout import GridLayout
- from kivy.uix.stacklayout import StackLayout
- from kivy.uix.scrollview import ScrollView
- from kivy.graphics import Rectangle, Color
- class UpLabel(Label):
- pass
- class UpStack(StackLayout):
- pass
- class UpFloat(FloatLayout):
- pass
- class Main(App):
- def build(self):
- StackList = CreateUpdate(ActualUpdates)
- print StackList
- Stack = UpStack(pos_hint= {'center_x':0.5, 'center_y':0.5},
- spacing=10)
- for i in range(0, len(StackList)):
- # MyFloats.append(UpFloat())
- # MyFloats[i].add_widget(StackList[i])
- Stack.add_widget(StackList[i])
- return Stack
- ActualUpdates = ['This is an update',
- 'This is also an update',
- 'this is the third updates',
- 'boo Yeah!, Longer list of updates!',
- 'Jan 26: Updates are updated',
- 'Thank our Lord and savior for updates',
- 'Peter would like this update',
- 'This is a good update']
- def CreateUpdate(LOS):
- MyStack = []
- MyLabs = []
- MyFloat = []
- for i in range(0, len(LOS)):
- MyLabs.append(UpLabel(text=LOS[i]))
- MyStack.append(UpStack(pos_hint= {'center_x':0.5, 'center_y':0.5},
- spacing=0,
- color=(0,1,1)))
- MyFloat.append(UpFloat())
- MyStack[i].add_widget(UpLabel(text='UPDATE'))
- MyStack[i].add_widget(MyLabs[i])
- MyFloat[i].add_widget(MyStack[i])
- return MyFloat
- root = Builder.load_string('''
- <UpLabel>:
- size_hint: None, None
- width: self.texture_size[0] + dp(12)
- height: self.texture_size[1]
- <UpStack>:
- orientation: 'lr-tb'
- size_hint: None, None
- height: self.minimum_height
- width: 1
- <UpFloat>:
- size_hint: 10, 10
- canvas:
- Color:
- rgba: (0, 0, 1, 1.)
- Rectangle:
- size: self.size
- pos: self.pos
- ''')
- if __name__ == "__main__":
- Main().run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement