1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 16:35:09 +00:00
serenity/Base/res/devel/templates/cpp-gui/main.cpp
2022-09-01 14:25:31 +01:00

26 lines
619 B
C++

#include <LibGUI/Application.h>
#include <LibGUI/Button.h>
#include <LibGUI/MessageBox.h>
#include <LibGUI/Window.h>
#include <stdio.h>
int main(int argc, char** argv)
{
auto app = GUI::Application::construct(argc, argv);
auto window = GUI::Window::construct();
window->set_title("Hello friends!");
window->resize(200, 100);
auto button = GUI::Button::construct();
button->set_text("Click me!");
button->on_click = [&](auto) {
GUI::MessageBox::show(window, "Hello friends!"sv, ":^)"sv);
};
window->set_main_widget(button);
window->show();
return app->exec();
}