Creates a thread.
| 85 | ## Class for creating a new thread. |
| 86 | # |
| 87 | class makeThread (Thread): |
| 88 | """Creates a thread.""" |
| 89 | |
| 90 | ## Constructor. |
| 91 | # @param func function to run on this thread. |
| 92 | # |
| 93 | def __init__ (self,func): |
| 94 | Thread.__init__(self) |
| 95 | self.__action = func |
| 96 | self.debug = False |
| 97 | |
| 98 | ## Destructor. |
| 99 | # |
| 100 | def __del__ (self): |
| 101 | if ( self.debug ): print ("Thread end") |
| 102 | |
| 103 | ## Starts this thread. |
| 104 | # |
| 105 | def run (self): |
| 106 | if ( self.debug ): print ("Thread begin") |
| 107 | self.__action() |
| 108 | |
| 109 | ## Class for drawing a simple analog clock. |
| 110 | # The backgroung image may be changed by pressing key 'i'. |