MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / change

Method change

DemoPrograms/Demo_Desktop_Widget_CPU_Gauge.py:239–259  ·  view source on GitHub ↗

Rotation of pointer call it with degree and step to set initial options for rotation. Without any option to start rotation.

(self, degree=None, step=1)

Source from the content-addressed store, hash-verified

237 self.pointer.move(delta_x, delta_y)
238
239 def change(self, degree=None, step=1):
240 """
241 Rotation of pointer
242 call it with degree and step to set initial options for rotation.
243 Without any option to start rotation.
244 """
245 if self.pointer:
246 if degree != None:
247 self.pointer.stop_degree = degree
248 self.pointer.step = step if self.pointer.all[2] < degree else -step
249 return True
250 now = self.pointer.all[2]
251 step = self.pointer.step
252 new_degree = now + step
253 if ((step > 0 and new_degree < self.pointer.stop_degree) or
254 (step < 0 and new_degree > self.pointer.stop_degree)):
255 self.pointer.new(degree=new_degree)
256 return False
257 else:
258 self.pointer.new(degree=self.pointer.stop_degree)
259 return True
260
261ALPHA = 0.5
262THEME = 'Dark purple 6 '

Callers 1

mainFunction · 0.95

Calls 1

newMethod · 0.45

Tested by

no test coverage detected