demo_colors.py
changeset 62 2f61931520c9
parent 60 fccca2a60492
child 70 db2eab0beb45
--- a/demo_colors.py	Thu Jan 10 00:03:34 2013 +0100
+++ b/demo_colors.py	Fri Jan 18 22:36:50 2013 +0100
@@ -4,27 +4,27 @@
 import locale
 locale.setlocale(locale.LC_ALL, '')
 
-from tuikit import Application, Window, Label, VerticalLayout
+from tuikit import Application, Window, Label, AnchorLayout, VerticalLayout
 
 
 class MyApplication(Application):
     def __init__(self):
-        Application.__init__(self)
+        Application.__init__(self, top_layout=AnchorLayout)
         self.top.add_handler('keypress', self.on_top_keypress)
 
-        win = Window()
-        self.top.add(win)
-        win.layout = VerticalLayout()
+        win = Window(inner_layout=VerticalLayout)
+        win.resize(30,10)
+        win.title = 'styles'
 
         for attr in ['blink', 'bold', 'standout', 'underline']:
             label = Label(attr)
             label.color = 'test-' + attr
-            self.top.add(label)
+            win.add(label)
 
-        self.top.layout = VerticalLayout()
+        self.top.add(win)
 
-    def applytheme(self):
-        Application.applytheme(self)
+    def apply_theme(self):
+        Application.apply_theme(self)
         self.driver.setcolor('test-blink',              'cyan on blue, blink')
         self.driver.setcolor('test-bold',               'cyan on blue, bold')
         self.driver.setcolor('test-standout',           'cyan on blue, standout')