Window Management Overview
The Window Management module in ProGUI provides the fundamental functions for creating, manipulating, and interacting with the main application windows. These are the top-level containers for all other UI elements.
Key functionalities include:
- Creation: Use CreateWindow() to instantiate a new window, specifying initial position, size, title, and various flags (like borderless, sizeable, minimize/maximize controls). Each window automatically gets a root layout container.
- Properties: Retrieve and modify core window properties such as title (WindowSetTitle(), WindowGetTitle()), size (WindowGetWidth(), WindowGetHeight()), position (WindowGetX(), WindowGetY()), and unique OS ID (WindowGetID()).
- Visibility & State: Control whether a window is visible using WindowShow(), which accepts flags for centering or preventing activation upon showing.
- DPI Awareness: ProGUI windows are DPI-aware. Functions like
WindowGetDpiX() and WindowGetDpiScaleX() allow querying the current DPI
settings and scale factors applied to the window, essential for correct rendering and layout
calculations on high-resolution displays. Events (
#PG_Event_DPI) are dispatched when DPI changes. - Drawing & Redrawing: Manage the window's appearance using WindowRedraw() to invalidate specific regions or the entire window, triggering a redraw operation. WindowUpdate() forces a layout recalculation and redraw.
- Layout Integration: Access the window's primary layout container using WindowGetLayout(), which serves as the root for adding widgets.
- Mouse Capture: Confine mouse input to a specific window using WindowSetMouseCapture() and release it with WindowReleaseMouseCapture().
- Events: Windows are event sources and targets. Use AddEventHandler() to
listen for window-specific events like
#PG_Event_WindowClose,#PG_Event_DPI,#PG_Event_Draw,#PG_Event_DrawForeground, and general mouse events when the mouse is over the window but not over a specific widget.