demos/03_application.py
author Radek Brich <radek.brich@devl.cz>
Fri, 28 Mar 2014 10:44:29 +0100
changeset 94 e50dae408fe9
parent 92 b97c4e25ed6d
child 97 0c2e0c09ba5c
permissions -rwxr-xr-x
Add origin to Buffer. Use it to simplify hierarchical drawing.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
86
0978fb755d31 Add core Application (adjusted), Window (new version), Signal (replaces Emitter), Size (adjusted). Add application demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     1
#!/usr/bin/env python3
0978fb755d31 Add core Application (adjusted), Window (new version), Signal (replaces Emitter), Size (adjusted). Add application demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     2
92
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents: 89
diff changeset
     3
import demobase
86
0978fb755d31 Add core Application (adjusted), Window (new version), Signal (replaces Emitter), Size (adjusted). Add application demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     4
0978fb755d31 Add core Application (adjusted), Window (new version), Signal (replaces Emitter), Size (adjusted). Add application demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     5
from tuikit.core.application import Application
87
ee5ea9671f28 Add core Widget, Container. Add widgets Label.
Radek Brich <radek.brich@devl.cz>
parents: 86
diff changeset
     6
from tuikit.widgets.label import Label
89
94f5baef19ac Add Theme, Button.
Radek Brich <radek.brich@devl.cz>
parents: 87
diff changeset
     7
from tuikit.widgets.button import Button
86
0978fb755d31 Add core Application (adjusted), Window (new version), Signal (replaces Emitter), Size (adjusted). Add application demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     8
87
ee5ea9671f28 Add core Widget, Container. Add widgets Label.
Radek Brich <radek.brich@devl.cz>
parents: 86
diff changeset
     9
label = Label('Hello there!')
ee5ea9671f28 Add core Widget, Container. Add widgets Label.
Radek Brich <radek.brich@devl.cz>
parents: 86
diff changeset
    10
label.pos.update(20, 10)
86
0978fb755d31 Add core Application (adjusted), Window (new version), Signal (replaces Emitter), Size (adjusted). Add application demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    11
89
94f5baef19ac Add Theme, Button.
Radek Brich <radek.brich@devl.cz>
parents: 87
diff changeset
    12
button = Button()
94f5baef19ac Add Theme, Button.
Radek Brich <radek.brich@devl.cz>
parents: 87
diff changeset
    13
button.pos.update(20, 20)
94f5baef19ac Add Theme, Button.
Radek Brich <radek.brich@devl.cz>
parents: 87
diff changeset
    14
86
0978fb755d31 Add core Application (adjusted), Window (new version), Signal (replaces Emitter), Size (adjusted). Add application demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    15
app = Application()
87
ee5ea9671f28 Add core Widget, Container. Add widgets Label.
Radek Brich <radek.brich@devl.cz>
parents: 86
diff changeset
    16
app.root_window.add(label)
89
94f5baef19ac Add Theme, Button.
Radek Brich <radek.brich@devl.cz>
parents: 87
diff changeset
    17
app.root_window.add(button)
86
0978fb755d31 Add core Application (adjusted), Window (new version), Signal (replaces Emitter), Size (adjusted). Add application demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    18
app.start()