nspyre.gui.widgets.update_loop

Module Contents

Classes

UpdateLoop

Runs a function repeatedly in a new thread.

class nspyre.gui.widgets.update_loop.UpdateLoop(update_func, *args, report_fps=False, fps_period=1, **kwargs)

Runs a function repeatedly in a new thread.

Parameters:
  • update_func (Callable) – Function to run repeatedly.

  • args – Arguments to pass to the function

  • kwargs – Keyword arguments to pass to the function.

  • report_fps (bool) – Whether to log the frames-per-second (how many times update_func is running per second).

  • fps_period (float) – How often (s) to report the frames-per-second.

updated

Qt Signal emitted when the update function finished.

start()

Start the update loop.

stop()

Stop the update loop. Block until the most recent update has finished.