leads_gui.prototype#
Module Contents#
Classes#
Functions#
Data#
API#
- leads_gui.prototype.parse_color(color: leads_gui.types.Color) str#
- leads_gui.prototype.autoscale(master: tkinter.Misc, s: float) float#
- leads_gui.prototype.autoscale_font(master: tkinter.Misc, font: leads_gui.types.Font) leads_gui.types.Font#
- class leads_gui.prototype.CanvasBased(master: tkinter.Misc, theme_key: str, width: float = 0, height: float = 0, fg_color: leads_gui.types.Color | None = None, hover_color: leads_gui.types.Color | None = None, bg_color: leads_gui.types.Color | None = None, corner_radius: float | None = None, clickable: bool = False, command: Callable[[tkinter.Event], None] = lambda _: ...)#
Bases:
customtkinter.CTkCanvasInitialization
- lock_ratio(ratio: float) Self#
Adjust the height according to the width to keep a constant ratio. :param ratio: height / width :return: self
- meta() tuple[float, float, float, float, float]#
- Returns:
(w, h, hc, vc, limit)
- collect(tag: str, object_id: int) None#
Collect a widget and link it to the tag for recycling. :param tag: the widget tag :param object_id: the widget id returned during creation
- clear(prefix: str = '') None#
Recycle the widgets linked to tags that start with the specified prefix. :param prefix: the tag prefix
- draw_fg(fg_color: leads_gui.types.Color, hover_color: leads_gui.types.Color, corner_radius: float) None#
- dynamic_renderer(canvas: Self) None#
The dynamic renderer should only render the content-based components. The dynamic renderer should only access the parameters from self, and then render on the specified canvas. :param canvas: the canvas to render on
- partially_render() None#
- raw_renderer(canvas: Self) None#
The raw renderer should only access the parameters from self, and then render on the specified canvas. :param canvas: the canvas to render on
- render() None#
- class leads_gui.prototype.TextBased(master: tkinter.Misc, theme_key: str, width: float = 0, height: float = 0, font: leads_gui.types.Font | None = None, text_color: leads_gui.types.Color | None = None, fg_color: leads_gui.types.Color | None = None, hover_color: leads_gui.types.Color | None = None, bg_color: leads_gui.types.Color | None = None, corner_radius: float | None = None, clickable: bool = False, command: Callable[[tkinter.Event], None] = lambda _: ...)#
Bases:
leads_gui.prototype.CanvasBasedInitialization
- class leads_gui.prototype.VariableControlled(variable: customtkinter.Variable)#
Bases:
objectInitialization
- attach(callback: Callable[[], None]) None#
- detach() None#
- class leads_gui.prototype.FrequencyGenerator(period: int, loops: int = -1)#
Bases:
objectInitialization
- Parameters:
period – the period in milliseconds
loops – the number of loops or -1 to indicate infinite loops
- abstractmethod do() None#
- attempt() bool#
Attempt to run. :return: True: active; False: deprecated
- class leads_gui.prototype._RuntimeData#
Bases:
objectInitialization
- __setattr__(key: str, value: Any) None#
- comm_notify(d: leads.DataContainer | dict[str, Any]) None#
- comm_stream_notify(tag: Literal[frvc, lfvc, rtvc, revc], frame: bytes) None#
- leads_gui.prototype._runtime_data_singleton_flag: bool = False#
- class leads_gui.prototype.RuntimeData#
Bases:
leads_gui.prototype._RuntimeDataInitialization
- __new__(*args, **kwargs) leads_gui.prototype._RuntimeData#
- class leads_gui.prototype.Window(master: tkinter.Misc | None = None, width: int = 720, height: int = 480, title: str = 'LEADS', fullscreen: bool = False, no_title_bar: bool = True, display: int = 0, popup: bool = False)#
Bases:
objectInitialization
- screen_index() int#
- screen_width() int#
- screen_height() int#
- width() int#
- height() int#
- root() customtkinter.CTk#
- show() None#
- kill() None#
- leads_gui.prototype.T = '_TypeVar(...)'#
- class leads_gui.prototype.Pot(width: int, height: int, refresh_rate: int, runtime_data: leads_gui.prototype.T, on_refresh: Callable[[Self], None] = lambda _: ..., title: str = 'LEADS', fullscreen: bool = False, no_title_bar: bool = True, theme_mode: Literal[system, light, dark] = 'system', display: int = 0)#
Bases:
leads_gui.prototype.Window,typing.Generic[leads_gui.prototype.T]Initialization
- frame_rate() float#
- net_delay() float#
- refresh_rate() int#
- runtime_data() leads_gui.prototype.T#
- set_on_refresh(on_refresh: Callable[[Self], None]) None#
- add_frequency_generator(tag: str, frequency_generator: leads_gui.prototype.FrequencyGenerator) None#
- remove_frequency_generator(tag: str) None#
- clear_frequency_generators() None#
- active() bool#
- show() None#
- class leads_gui.prototype.ContextManager(*windows: leads_gui.prototype.Window)#
Bases:
objectInitialization
- num_windows() int#
- _allocate_window() int#
- add_window(window: leads_gui.prototype.Window) int#
- remove_window(index: int) None#
- index_of_window(window: leads_gui.prototype.Pot) int#
- __setitem__(key: str, widget: leads_gui.types.Widget) None#
- __getitem__(key: str) leads_gui.types.Widget#
- set(key: str, widget: leads_gui.types.Widget) None#
- get(key: str) leads_gui.types.Widget#
- parse_layout(layout: list[list[str | leads_gui.types.Widget | None]]) list[list[leads_gui.types.Widget | None]]#
- layout(layout: list[list[str | leads_gui.types.Widget | None]], padding: float = 0.005, window_index: int = -1) None#
- window(index: int = -1) leads_gui.prototype.Pot#
- show() None#
- kill() None#