AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
examples/ui/minimal_ui_xmake/src/MainWindow.cpp
Note
This Source File belongs to Minimal UI Template XMake Example. Please follow the link for example explanation.
#include "MainWindow.h"
#include <AUI/Util/UIBuildingHelpers.h>
#include <AUI/View/ALabel.h>
#include <AUI/View/AButton.h>
#include <AUI/Platform/APlatform.h>
using namespace declarative;
MainWindow::MainWindow(): AWindow("Project template app", 300_dp, 200_dp) {
    setContents(
        Centered{
            Vertical{
                Centered { Label { "Hello world from AUI!" } },
                _new<AButton>("Visit GitHub repo").connect(&AView::clicked, this, [] {
                    APlatform::openUrl("https://github.com/aui-framework/aui");
                }),
                _new<AButton>("Visit docs").connect(&AView::clicked, this, [] {
                    APlatform::openUrl("https://aui-framework.github.io/");
                }),
                _new<AButton>("Submit an issue").connect(&AView::clicked, this, [] {
                    APlatform::openUrl("https://github.com/aui-framework/aui/issues/new");
                }),
            }
        }
    );
}
emits clicked
Left mouse button clicked.
Definition AView.h:945
Represents a window in the underlying windowing system.
Definition AWindow.h:45
API_AUI_VIEWS void openUrl(const AUrl &url)
Opens a URL using the system's default application.
Declarative form of ALabel.
Definition ALabel.h:35