#-*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.widget import Widget
from kivy.uix.label import Label
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.boxlayout import BoxLayout
class myApp(App):
def build(self):
gl = BoxLayout(orientation = "vertical", padding=[200, 100], spacing=30)
self.lbl = Label(text = 'привет ты мальчик?', font_size = 50)
gl.add_widget(self.lbl)
gl.add_widget(Button(text = 'да', font_size = 30, background_color = [.32,.85,.94,1], on_press=self.update_label))
gl.add_widget(Button(text = 'нет', font_size = 30, background_color = [1 ,0 ,0, 1]))
return gl
def update_label(self, instance):
self.lbl.text = "Привет МАЛЬЧИК"
if __name__ =="__main__":
myApp().run()
layout = BoxLayout(orientation='vertical')
btn1 = Button(text='Hello')
btn2 = Button(text='World')
layout.add_widget(btn1)
layout.add_widget(btn2)
for x in items.get('razdely'):
item = AccordionItem(title=x.get("text"))
#~ item.add_widget(Button(text="Кнопка N1"))
#~ item.add_widget(Button(text="Кнопка N2"))
#~ item.add_widget(layout)
layout = BoxLayout(orientation='vertical')
btn1 = Button(text='Hello')
btn2 = Button(text='World')
layout.add_widget(btn1)
layout.add_widget(btn2)
item.add_widget(layout)
root.add_widget(item)