MCPcopy Create free account
hub / github.com/ActiveState/code / __init__

Method __init__

recipes/Python/576830_analog_clock/recipe-576830.py:51–72  ·  view source on GitHub ↗
(self,root,deltahours = 0)

Source from the content-addressed store, hash-verified

49class 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()

Callers

nothing calls this directly

Calls 7

configureMethod · 0.95
pollMethod · 0.95
transformerClass · 0.70
bindMethod · 0.45
destroyMethod · 0.45
titleMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected