Basic GUI infrastructure

This commit is contained in:
2025-07-28 15:00:25 +02:00
commit 4e1a9f0182
8 changed files with 180 additions and 0 deletions

20
widgets/base_widget.py Normal file
View File

@ -0,0 +1,20 @@
import dearpygui.dearpygui as dpg
import logging
class BaseWidget:
"""A base class to handle common functionality for all widgets."""
def __init__(self, widget_type: str, config: dict, layout_manager):
self.widget_type = widget_type
self.config = config
self.layout_manager = layout_manager
self.window_tag = f"widget_win_{self.widget_type}"
def create(self):
raise NotImplementedError
def get_config(self) -> dict:
return self.config
def _on_window_close(self, sender, app_data, user_data):
logging.info(f"Hiding widget: {self.widget_type}")
dpg.configure_item(self.window_tag, show=False)