2
Window
josh edited this page 2025-02-04 15:41:39 -05:00

Window

The Window widget is a complex Widget that provides a self-contained, resizable, draggable, togglable, rectangular "Window", complete with all the facilities you expect of a windowing system.

Creating a Window

Construction of a window is like all other widgets. It can technically be parented to any other widget (even another Window), but we designed it to be parented to Scenes.


auto* myWindow = new JUI::Window(scene);

myWindow->MinSize({400, 200});
myWindow->MaxSize({800, 400});
myWindow->SetResizable(true);

Window Components

We termed the Window a 'Complex Widget'. This is because it is composed of multiple widgets, working together.

The sub-components of the window are exposed via API getters.

JUI::Text* Window::GetTitleInsance();
JUI::Rect* Window::GetTopbarInstance();
JUI::Rect* Window::GetViewportInstance();
JUI::TextButton* Window::GetExitButtonInstance();

Additionally, the Window element itself is a specialization of the Rect widget as well.

Styling a Window

Adding Topbar Buttons

(This section is a stub as the API is still under development.)