demo_window.py
changeset 28 feee783d4fc5
parent 19 5e78d52ebb24
child 29 c0cdef06fd16
equal deleted inserted replaced
27:139d1241b4c5 28:feee783d4fc5
     1 #!/usr/bin/env python3
     1 #!/usr/bin/env python3
     2 # -*- coding: utf-8 -*-
     2 # -*- coding: utf-8 -*-
     3 
     3 
       
     4 import cProfile, pstats
     4 import locale
     5 import locale
     5 import os
     6 import os
     6 
     7 
     7 from tuikit.application import Application
     8 from tuikit.application import Application
     8 from tuikit.editfield import EditField
       
     9 from tuikit.window import Window
     9 from tuikit.window import Window
    10 from tuikit.button import Button
    10 from tuikit.button import Button
    11 
    11 
    12 
    12 
    13 class MyApplication(Application):
    13 class MyApplication(Application):
    44 
    44 
    45 if __name__ == '__main__':
    45 if __name__ == '__main__':
    46     locale.setlocale(locale.LC_ALL, '')
    46     locale.setlocale(locale.LC_ALL, '')
    47     os.environ['ESCDELAY'] = '25' # do not wait 1 second after pressing Escape key
    47     os.environ['ESCDELAY'] = '25' # do not wait 1 second after pressing Escape key
    48     app = MyApplication()
    48     app = MyApplication()
    49     app.start()
    49     #app.start()
       
    50     
       
    51     cProfile.run('app.start()', 'appstats')
       
    52     p = pstats.Stats('appstats')
       
    53     p.sort_stats('time', 'cumulative').print_stats(20)
    50 
    54