Skip to content

Instantly share code, notes, and snippets.

@AphonicChaos
Forked from philwrenn/actionbar_example.py
Created February 21, 2014 08:19
Show Gist options
  • Save AphonicChaos/9130590 to your computer and use it in GitHub Desktop.
Save AphonicChaos/9130590 to your computer and use it in GitHub Desktop.
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
Builder.load_string('''
<ActionBarDummy>
ActionBar:
pos_hint: {'top':1}
ActionView:
ActionPrevious:
title: 'Recipes'
with_previous: False
ActionGroup:
id: action_group
mode: 'spinner'
text: 'Some Actions'
ActionButton:
text: 'Action 1'
on_release: action_group._dropdown.select(root.do_something())
ActionButton:
text: 'Action 2'
on_release: action_group._dropdown.select(root.do_something())
ActionButton:
text: 'Action 3'
on_release: action_group._dropdown.select(root.do_something())
''')
class ActionBarDummy(BoxLayout):
def __init__(self, **kwargs):
super(ActionBarDummy, self).__init__()
def do_something(self):
print("ActionButton was clicked." )
class ActionBarApp(App):
def build(self):
return ActionBarDummy()
if __name__ in ('__main__', '__android__'):
ActionBarApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment