Toga — yet another GUI toolkit
Дмитрий Овчинников
Wargaming.net
Python Meetup Minsk, 02/2015
Kivy
Toga
Toga
1. Python native, OS native, cross platform GUI toolkit.
2. Linux
3. OS X
4. Windows (crappy)
5. iOS (crappier)
6. Android (the crappiest)
Architecture
Native widgets
Example
import toga
def button_handler(widget):
toga.Dialog.info('Yay!', 'You have clicked the button')
def startup(app):
container = toga.Container()
button = toga.Button('Hello world', on_press=button_handler)
container.add(button)
if __name__ == '__main__':
app = toga.App('First App', 'org.python.meetup.toga')
app.main_loop()
Example #2
container = toga.OptionContainer()
left_table = toga.Table(['Hello', 'World'])
left_table.insert(None, 'root1', 'value1')
left_table.insert(None, 'root2', 'value2')
left_table.insert(None, 'root3', 'value3')
left_table.insert(1, 'root4', 'value4')
left_tree = toga.Tree(['Navigate'])
left_tree.insert(None, None, 'root1')
root2 = left_tree.insert(None, None, 'root2')
left_tree.insert(root2, None, 'root2.1')
root2_2 = left_tree.insert(root2, None, 'root2.2')
left_tree.insert(root2_2, None, 'root2.2.1')
left_tree.insert(root2_2, None, 'root2.2.2')
left_tree.insert(root2_2, None, 'root2.2.3')
container.add('Table', left_table)
container.add('Tree', left_tree)
Looks good?
The big "but"
1. No threads
2. No widgets
3. No customization
4. Almost nothing
What's the point?
1. Simple
2. Well designed (so far)
3. No extra credit
4. Made by one person
5. Worth mention
Beeware
1. Cricket
2. BugJar
3. Duvet
4. rubicon
etc...
In conclusion
1. There is always a small nice library
2. Someone does these libraries
3. Why won't you?
4. Get off the bench!
Links
Sorry for being boring
Here is a potato
Toga — yet another GUI toolkit
By Dmitry Ovchinnikov
Toga — yet another GUI toolkit
- 3,476