Nirdesh Kumawat
Nirdesh Kumawat

Reputation: 406

Create a dropdown menu at the top of the window

How to create a dropdown menu at the top of the window (like "File", "Edit", and "Tools") in Kivy?

Upvotes: 3

Views: 5961

Answers (1)

PalimPalim
PalimPalim

Reputation: 3058

How about using ActionBar

enter image description here

from kivy.app import App
from kivy.lang import Builder

kv_str = Builder.load_string('''
ActionBar:
    pos_hint: {'top':1}
    ActionView:
        use_separator: True
        ActionPrevious:
            title: 'Example App'
            with_previous: False
        ActionButton:
            text: 'File'
        ActionButton:
            text: 'Edit'
        ActionGroup:
            text: 'Tools' 
            mode: 'spinner'
            ActionButton:
                text: 'Tool1'
            ActionButton:
                text: 'Tool2'
            ActionButton:
                text: 'Tool3'
            ActionButton:
                text: 'Tool4'
''')


class ExampleApp(App):
    def build(self):
        return kv_str

if __name__ =='__main__':
    ExampleApp().run()

Upvotes: 11

Related Questions