| 212 | ## Draws the handles. |
| 213 | # |
| 214 | def painthms(self): |
| 215 | self.canvas.delete(self._ALL) # delete the handles |
| 216 | T = datetime.timetuple(datetime.utcnow()-self.delta) |
| 217 | x,x,x,h,m,s,x,x,x = T |
| 218 | self.root.title('%02i:%02i:%02i' %(h,m,s)) |
| 219 | angle = pi/2 - pi/6 * (h + m/60.0) |
| 220 | x, y = cos(angle)*0.70,sin(angle)*0.70 |
| 221 | scl = self.canvas.create_line |
| 222 | # draw the hour handle |
| 223 | scl(self.T.windowToViewport(0,0,x,y), fill = self.timecolor, tag=self._ALL, width = self.pad/3) |
| 224 | angle = pi/2 - pi/30 * (m + s/60.0) |
| 225 | x, y = cos(angle)*0.90,sin(angle)*0.90 |
| 226 | # draw the minute handle |
| 227 | scl(self.T.windowToViewport(0,0,x,y), fill = self.timecolor, tag=self._ALL, width = self.pad/5) |
| 228 | angle = pi/2 - pi/30 * s |
| 229 | x, y = cos(angle)*0.95,sin(angle)*0.95 |
| 230 | # draw the second handle |
| 231 | scl(self.T.windowToViewport(0,0,x,y), fill = self.timecolor, tag=self._ALL, arrow = 'last') |
| 232 | |
| 233 | ## Draws a circle at a given point. |
| 234 | # |