Created
August 4, 2012 20:09
-
-
Save killerswan/3259660 to your computer and use it in GitHub Desktop.
kivy, not working yet
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
| BoxLayout: | |
| orientation: 'horizontal' | |
| TextInput: | |
| id: p0 | |
| TextInput: | |
| id: p1 | |
| Label: | |
| id: g0 | |
| Button: | |
| id: c0 | |
| on_release: copy() |
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
| #!/usr/bin/env python | |
| from kivy.app import App | |
| from kivy.uix.boxlayout import BoxLayout | |
| from kivy.uix.textinput import TextInput | |
| from kivy.uix.label import Label | |
| from kivy.uix.button import Button | |
| layout = BoxLayout() | |
| pass0 = TextInput(text="<initial passphrase0>") | |
| layout.add_widget(pass0) | |
| pass1 = TextInput(text="<initial passphrase1>") | |
| layout.add_widget(pass1) | |
| gen0 = Label(text="<generated passphrase>") | |
| layout.add_widget(gen0) | |
| button0 = Button(text="Copy to clipboard") | |
| layout.add_widget(button0) | |
| def copy(self): | |
| gen0.text = "cp: " + pass0.text + pass1.text | |
| def on_more_text(instance, value): | |
| gen0.text = pass0.text + pass1.text | |
| pass1.bind(text=on_more_text) | |
| class GeneratorApp(App): | |
| def build(self): | |
| return layout | |
| #pass | |
| if __name__ == '__main__': | |
| GeneratorApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment