Last active
December 27, 2015 11:39
-
-
Save Eugeny/7320615 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ajenti.api import plugin | |
from ajenti.plugins.main.api import SectionPlugin | |
from ajenti.ui import on, p, UIElement | |
from ajenti.ui.binder import Binder | |
@plugin | |
class Test (SectionPlugin): | |
def init(self): | |
self.title = 'Controls 2' | |
self.icon = 'smile' | |
self.category = 'Demo' | |
self.append(self.ui.inflate('test_new_dropdown:main')) | |
self.find('dropdown').labels = ['None', 'Int', 'Object'] | |
self.find('dropdown').values = [None, 1, object()] | |
self.value = None | |
self.binder = Binder(self, self) | |
self.binder.autodiscover().populate() | |
@on('check', 'click') | |
def on_show(self): | |
self.binder.update() | |
print repr(self.value) | |
self.binder.reset().populate() |
This file contains hidden or 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
<body> | |
<pad> | |
<vc> | |
<formline text="Dropdown"> | |
<dropdown id="dropdown" bind:value="value" /> | |
</formline> | |
<formline> | |
<button icon="ok" id="check" text="Get value" /> | |
</formline> | |
</vc> | |
</pad> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment