2023-08-15 08:23:37 +00:00
|
|
|
#include <ui/App.h>
|
2023-08-14 16:15:38 +00:00
|
|
|
|
2023-08-07 20:45:00 +00:00
|
|
|
Result<int> luna_main(int argc, char** argv)
|
|
|
|
{
|
2023-08-15 08:23:37 +00:00
|
|
|
ui::App app;
|
|
|
|
TRY(app.init(argc, argv));
|
2023-08-14 18:08:05 +00:00
|
|
|
|
2023-08-15 09:20:17 +00:00
|
|
|
auto* window = TRY(ui::Window::create(ui::Rect { 200, 200, 400, 300 }));
|
|
|
|
app.set_main_window(window);
|
2023-08-14 18:08:05 +00:00
|
|
|
|
2023-08-15 09:20:17 +00:00
|
|
|
window->set_title("Main Window");
|
2023-08-15 08:23:37 +00:00
|
|
|
window->canvas().fill(ui::CYAN);
|
|
|
|
window->update();
|
2023-08-07 20:45:00 +00:00
|
|
|
|
2023-08-15 09:20:17 +00:00
|
|
|
auto* dialog = TRY(ui::Window::create(ui::Rect { 400, 400, 200, 150 }));
|
|
|
|
dialog->set_title("Error: Unknown Error");
|
|
|
|
dialog->canvas().fill(ui::RED);
|
|
|
|
dialog->update();
|
|
|
|
|
2023-08-15 08:23:37 +00:00
|
|
|
return app.run();
|
2023-08-07 20:45:00 +00:00
|
|
|
}
|