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

Method new

DemoPrograms/Demo_Desktop_Widget_RAM_Gauge.py:185–198  ·  view source on GitHub ↗

Draw ticks on clock

(self)

Source from the content-addressed store, hash-verified

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

Callers 9

__init__Method · 0.95
make_squareFunction · 0.45
mainFunction · 0.45
make_squareFunction · 0.45
mainFunction · 0.45
changeMethod · 0.45
make_squareFunction · 0.45
set_image_to_blankFunction · 0.45
make_squareFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected