Window Manager - Horizon-NTH/HorizonGUI GitHub Wiki

WindowManager

Overview

The WindowManager class, located in the hgui namespace, provides a flexible way to create and manage Windows in your graphical application. The class can be found inside the header file WindowManager.h.

Member Functions

  • std::shared_ptr<kernel::Window> create(const std::string& windowName, const size& size, const point& position, const std::shared_ptr<kernel::Image>& icon = nullptr, const std::shared_ptr<kernel::Monitor>& monitor = nullptr, const std::map<options, bool>& options = {}): Creates a new window with the specified properties, such as window name, size, position, icon, monitor, and additional options.

Example Usage

#include <hgui/header/WindowManager.h>

{ // Example Usage of WindowManager
    std::string windowName = "My Window";
    hgui::size windowSize(800, 600);
    hgui::point windowPosition(100, 100);
    std::shared_ptr<hgui::kernel::Image> icon = /* initialize window icon */;
    std::shared_ptr<hgui::kernel::Monitor> monitor = /* initialize monitor */;
    std::initializer_list<std::pair<hgui::options, bool>> windowOptions = { /* initialize window options */ };

    // Create a window with the specified properties
    std::shared_ptr<hgui::kernel::Window> myWindow = hgui::WindowManager::create(windowName, windowSize, windowPosition, icon, monitor, windowOptions);

    // Use the window as needed
    // (Display graphical content in the window)
} // Here the window is destroyed

Note: In the "Example Usage" section, we demonstrate how to create a custom window with the WindowManager class.