pyrcf.utils.gui_utils.tkinter_gui_utils

Classes

TkinterWidgetMaster

Handles a Tk window (called 'master').

_COMMON_TK_MASTER

Internal class that creates a singleton instance of TkinterWidgetMaster

TkinterGUISlider

Create a slider gui in Tkinter.

TkinterGUIButton

Create a button in Tkinter GUI, and check if it was pressed.

Module Contents

class pyrcf.utils.gui_utils.tkinter_gui_utils.TkinterWidgetMaster(max_update_rate: float = 100, window_name: str = 'Default Tk Master')

Handles a Tk window (called ‘master’).

master_widget
trigger
update()

The update method to be called in a loop to refresh all the widgets attached to this window. This will call the master update only if the rate specified during construction is met.

class pyrcf.utils.gui_utils.tkinter_gui_utils._COMMON_TK_MASTER

Internal class that creates a singleton instance of TkinterWidgetMaster to be used by all widgets when a default master is not specified.

__COMMON_TKINTER_MASTER: TkinterWidgetMaster = None
static _get_tkinter_common_master()
class pyrcf.utils.gui_utils.tkinter_gui_utils.TkinterGUISlider(name: str, lower_lim: float, upper_lim: float, default_val: float, tk_master: TkinterWidgetMaster = None, mapping_function: Callable[[float], float] = lambda x: ..., slider_resolution: float = 0.1)

Create a slider gui in Tkinter.

tk_master = None
slider
_mapping_function
get_value()

Read the value from the slider gui.

remove(permanent: bool = True)

Remove the slider from gui.

set_value(value: float)

Set the value of the slider to specified value.

Parameters:

value (float) – Value to set the slider to.

class pyrcf.utils.gui_utils.tkinter_gui_utils.TkinterGUIButton(name: str, tk_master: TkinterWidgetMaster = None)

Create a button in Tkinter GUI, and check if it was pressed. Meant to be used in a loop.

tk_master = None
_prev_val = 0
_val = 0
button
_button_press_cb()
was_pressed() bool

Checks if this button was pressed since the last time this method was called.

remove(permanent: bool = True)

Remove the slider from gui.