MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / new

Method new

DemoPrograms/Demo_Desktop_Widget_Count_To_A_Goal.py:189–203  ·  view source on GitHub ↗

Draw ticks on clock

(self)

Source from the content-addressed store, hash-verified

187 self.new()
188
189 def new(self):
190 """
191 Draw ticks on clock
192 """
193 (x, y, start_radius, stop_radius, start_angle, stop_angle, step,
194 line_color, line_width) = self.all
195 start_angle, stop_angle = (180 - start_angle, 180 - stop_angle
196 ) if stop_angle < start_angle else (180 - stop_angle, 180 - start_angle)
197 for i in range(start_angle, stop_angle + 1, step):
198 start_x = x + start_radius * math.cos(i / 180 * math.pi)
199 start_y = y + start_radius * math.sin(i / 180 * math.pi)
200 stop_x = x + stop_radius * math.cos(i / 180 * math.pi)
201 stop_y = y + stop_radius * math.sin(i / 180 * math.pi)
202 self.figure.append(self.graph_elem.DrawLine((start_x, start_y),
203 (stop_x, stop_y), color=line_color, width=line_width))
204
205 def move(self, delta_x, delta_y):
206 """

Callers 2

__init__Method · 0.95
changeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected