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

Method change

DemoPrograms/Demo_Desktop_Widget_RAM_Gauge.py:242–262  ·  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

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

Callers 1

mainFunction · 0.95

Calls 1

newMethod · 0.45

Tested by

no test coverage detected