tuikit/application.py
changeset 13 19ebde2fd594
parent 11 762513aacc87
child 15 c55b4749e562
--- a/tuikit/application.py	Thu Sep 08 10:13:55 2011 +0200
+++ b/tuikit/application.py	Thu Sep 08 11:37:27 2011 +0200
@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*-
 
-import curses
 import curses.wrapper
 import logging
 import time
@@ -11,7 +10,11 @@
 
 
 class TopWindow(Container):
+    
+    '''Top window of an application. Covers entire screen.'''
+    
     def __init__(self):
+        '''Create top window.'''
         Container.__init__(self)
 
         self.focuswidget = None
@@ -70,9 +73,17 @@
 
 
 class Application:
+    
+    '''Application class. Defines main loop.'''
+       
     def __init__(self):
+        '''Create application.'''
+        
+        '''Top window.'''
         self.top = TopWindow()
         self.quit = False
+        
+        '''Renderer class, i.e. BackendCurses.'''
         self.screen = None
 
         self.log = logging.getLogger('tuikit')
@@ -85,14 +96,17 @@
 
 
     def start(self):
+        '''Start application. Runs main loop.'''
         curses.wrapper(self.mainloop)
 
 
     def terminate(self):
+        '''Terminate application.'''
         self.quit = True
 
 
     def mainloop(self, screen):
+        '''The main loop.'''
         self.screen = BackendCurses(screen)
         self.applytheme()
         self.top.width, self.top.height = self.screen.width, self.screen.height
@@ -129,3 +143,4 @@
         screen.setcolor('button-active',           'black on cyan')
         screen.setcolor('menu',                    'black on cyan')
         screen.setcolor('menu-active',             'white on cyan, bold')
+