mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +00:00
Demos: Add a HelloWorld2 demo.
This is a simple test app with its UI generated from a VisualBuilder form. The name is probably silly, but who cares. :^)
This commit is contained in:
parent
b3d431e390
commit
0bf5c6fa3a
6 changed files with 58 additions and 0 deletions
26
Demos/HelloWorld2/main.cpp
Normal file
26
Demos/HelloWorld2/main.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GButton.h>
|
||||
#include <LibGUI/GLabel.h>
|
||||
#include <LibGUI/GWidget.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include "UI_HelloWorld2.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
GApplication app(argc, argv);
|
||||
|
||||
auto* window = new GWindow;
|
||||
window->set_rect(100, 100, 240, 160);
|
||||
window->set_title("Hello World!");
|
||||
|
||||
auto* ui = new UI_HelloWorld2;
|
||||
window->set_main_widget(ui->main_widget);
|
||||
|
||||
ui->w3->on_click = [&](auto&) {
|
||||
app.quit();
|
||||
};
|
||||
|
||||
window->show();
|
||||
return app.exec();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue