Skip to content

APlatform#

System-specific functions.

Header:#include <AUI/Platform/APlatform.h>
CMake:aui_link(my_target PUBLIC aui::views)

Examples#

examples/ui/minimal_ui_assets_xmake/src/MainWindow.cpp

Minimal UI Template XMake with Assets — Minimal UI boilerplate template XMake with AUI Assets.

            Vertical{
                Centered { Icon { ":img/logo.svg" } AUI_OVERRIDE_STYLE { FixedSize(64_dp) } },
                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, [] {
examples/ui/minimal_ui_xmake/src/MainWindow.cpp

Minimal UI Template XMake — Minimal UI boilerplate template XMake.

        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, [] {
examples/ui/views/src/ExampleWindow.cpp

Views Example — All-in-one views building example.

    return Label { url } AUI_OVERRIDE_STYLE {
               TextColor { AColor::BLUE },
               BorderBottom { 1_px, AColor::BLUE },
               ACursor::POINTER,
           } AUI_LET { AObject::connect(it->clicked, AObject::GENERIC_OBSERVER, [url] { APlatform::openUrl(url); }); };
}
/// [label_coloring]

static _<AView> checkBoxesDemo() {
    struct State {

Public Methods#

openUrl#


static void APlatform::openUrl(const AUrl& url)

Opens a URL using the system's default application.

Arguments
url
The URL to be opened, represented by an AUrl object.

Attempts to open the specified URL in the user's default web browser or appropriate application based on the URL schema. If opening the URL fails, an error message is logged with details about the failure.

Examples: