pyrcf.utils.gui_utils.tkinter_gui_utils ======================================= .. py:module:: pyrcf.utils.gui_utils.tkinter_gui_utils Classes ------- .. autoapisummary:: pyrcf.utils.gui_utils.tkinter_gui_utils.TkinterWidgetMaster pyrcf.utils.gui_utils.tkinter_gui_utils._COMMON_TK_MASTER pyrcf.utils.gui_utils.tkinter_gui_utils.TkinterGUISlider pyrcf.utils.gui_utils.tkinter_gui_utils.TkinterGUIButton Module Contents --------------- .. py:class:: TkinterWidgetMaster(max_update_rate: float = 100, window_name: str = 'Default Tk Master') Handles a Tk window (called 'master'). .. py:attribute:: master_widget .. py:attribute:: trigger .. py:method:: 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. .. py:class:: _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. .. py:attribute:: __COMMON_TKINTER_MASTER :type: TkinterWidgetMaster :value: None .. py:method:: _get_tkinter_common_master() :staticmethod: .. py:class:: TkinterGUISlider(name: str, lower_lim: float, upper_lim: float, default_val: float, tk_master: TkinterWidgetMaster = None, mapping_function: Callable[[float], float] = lambda x: x, slider_resolution: float = 0.1) Create a slider gui in Tkinter. .. py:attribute:: tk_master :value: None .. py:attribute:: slider .. py:attribute:: _mapping_function .. py:method:: get_value() Read the value from the slider gui. .. py:method:: remove(permanent: bool = True) Remove the slider from gui. .. py:method:: set_value(value: float) Set the value of the slider to specified value. :param value: Value to set the slider to. :type value: float .. py:class:: 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. .. py:attribute:: tk_master :value: None .. py:attribute:: _prev_val :value: 0 .. py:attribute:: _val :value: 0 .. py:attribute:: button .. py:method:: _button_press_cb() .. py:method:: was_pressed() -> bool Checks if this button was pressed since the last time this method was called. .. py:method:: remove(permanent: bool = True) Remove the slider from gui.