【Kivy】Drop-DownList を表示する

  • main.py
from kivy.app import App

class MainApp(App):
    pass

if __name__ == '__main__':
    MainApp().run()
  • main.kv
#:kivy 1.0
DropDown:
    size_hint: 1.0, 1.0
    Button:
        text: 'My first Item'
        size_hint_y: None
        height: 80
        on_release: root.select('item1')
    Label:
        text: 'Unselectable item'
        size_hint_y: None
        height: 80
    Button:
        text: 'My second Item'
        size_hint_y: None
        height: 80
        on_release: root.select('item2')

youtu.be

【Kivy】Carousel を表示する

  • main.py
from kivy.app import App

class MainApp(App):
    pass

if __name__ == '__main__':
    MainApp().run()
  • main.kv
#:kivy 1.0
Carousel:
    direction: 'right'
    Label:
        text: 'Item 1'
    Label:
        text: 'Item 2'
    Label:
        text: 'Item 3'
    Label:
        text: 'Item 4'

【Kivy】Bubble を表示する

  • main.py
from kivy.app import App

class MainApp(App):
    pass

if __name__ == '__main__':
    MainApp().run()
  • main.kv
#:kivy 1.0
BoxLayout:
    canvas.before:
        Color:
            rgba: 1, 1, 1, 1
        Rectangle:
            pos: self.pos
            size: self.size
    Bubble:
        size_hint: (None, None)
        size: (400, 100)
        BubbleButton:
            text: 'Cut'
        BubbleButton:
            text: 'Copy'
        BubbleButton:
            text: 'Paste'

youtu.be