-
-
Save AphonicChaos/9130590 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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