diff -r 43b2279b06e1 -r 2b43a7f38c34 demo_colors.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/demo_colors.py Sat Jan 05 00:37:11 2013 +0100 @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import locale +locale.setlocale(locale.LC_ALL, '') + +from tuikit import Application, Label, VerticalLayout + + +class MyApplication(Application): + def __init__(self): + Application.__init__(self) + self.top.add_handler('keypress', self.on_top_keypress) + + for attr in ['blink', 'bold', 'dim', 'standout', 'underline']: + label = Label(attr) + label.color = 'test-' + attr + self.top.add(label) + + self.top.layout = VerticalLayout() + + def on_top_keypress(self, ev): + if ev.keyname == 'escape': + self.terminate() + return True + + +if __name__ == '__main__': + app = MyApplication() + app.start() +