How christianharris-3/pyui works
Main Components
• Pygame Application Layer:
– Represent the main application or game loop (e.g. “basic start” script and pyuitesting) that sets up pygame, creates a display, and uses PyUI for rendering.
• PyUI Core (UI Class):
– Represent the central UI object (the “pyui.UI()” instance) that is instantiated by the user. This acts as the controller that maintains state, binds all GUI objects, and exposes the event handling (via loadtickdata) and rendering functions (via rendergui).
• GUI Object Factory and Components:
– List out the different GUI elements that can be created by the UI object. Create blocks for “Buttons,” “Checkboxes,” “Labels/Text,” “Textboxes,” “Tables (including scroller tables),” “Sliders/Scrollers,” “Windowed Menus/Windows,” and even “Composite Objects” (like Search Bar and DropDown).
• Style & Configuration System:
• In-built Image System:
• Utility Functions:
Depicting Relationships & Data Flow
• “Style & Configuration System” with the “PyUI Core” and “GUI Components” to indicate that styling information is propagated automatically (or via functions like ui.setstyle) to modify the appearance of each component.
• Link the “In-built Image System” with the “GUI Components” (particularly text objects and buttons) to illustrate that image rendering (both vector and manually drawn) is integrated into GUI objects.
Architectural Patterns and Design Details
• That the PyUI module employs a factory-like design where the UI object creates various GUI components.
• There is a separation of concerns: the module encapsulates GUI object creation, event handling, rendering, and styling into logically separate parts.
• The design supports extensibility—evidenced by having many configurable variables through its style system and the ability to add custom events or new GUI component types.
Technologies, Frameworks, and Libraries
• Explicitly mention pygame as the rendering backend and event manager used for all display and input processing.
• That while GitHub Actions (in .github/workflows) take care of automation and publishing, the core focus is on runtime behavior and visual GUI component management.
Essential Elements
• Clear labels and names for each node/component.
• Sub-blocks within the PyUI Core for “GUI Object Creation,” “Event Handling,” and “Style Updates” so that the responsibilities are clearly partitioned.
• Mention versioning components: note that older versions (contained in the “old PyUI versions” folder) exist but are separated from the current maintained core.