| 49 | class clock: |
| 50 | |
| 51 | def __init__(self,root,deltahours = 0): |
| 52 | self.world = [-1,-1,1,1] |
| 53 | self.bgcolor = '#000000' |
| 54 | self.circlecolor = '#808080' |
| 55 | self.timecolor = '#ffffff' |
| 56 | self.circlesize = 0.09 |
| 57 | self._ALL = 'all' |
| 58 | self.pad = 25 |
| 59 | self.root = root |
| 60 | WIDTH, HEIGHT = 400, 400 |
| 61 | root.bind("<Escape>", lambda _ : root.destroy()) |
| 62 | self.delta = timedelta(hours = deltahours) |
| 63 | self.canvas = Canvas(root, |
| 64 | width = WIDTH, |
| 65 | height = HEIGHT, |
| 66 | background = self.bgcolor) |
| 67 | viewport = (self.pad,self.pad,WIDTH-self.pad,HEIGHT-self.pad) |
| 68 | self.T = transformer(self.world,viewport) |
| 69 | self.root.title('Clock') |
| 70 | self.canvas.bind("<Configure>",self.configure()) |
| 71 | self.canvas.pack(fill=BOTH, expand=YES) |
| 72 | self.poll() |
| 73 | |
| 74 | def configure(self): |
| 75 | self.redraw() |