mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:07:36 +00:00
Userland: Make GUI::Window
construction non-fallible
This commit is contained in:
parent
b6b2c6f3e2
commit
0d7b13edac
55 changed files with 60 additions and 60 deletions
|
@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/etc/passwd", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("CatDog Demo");
|
||||
window->resize(32, 32);
|
||||
window->set_frameless(true);
|
||||
|
@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->set_always_on_top();
|
||||
catdog_widget->start_timer(250, Core::TimerShouldFireWhenNotVisible::Yes);
|
||||
|
||||
auto advice_window = TRY(GUI::Window::try_create());
|
||||
auto advice_window = GUI::Window::construct();
|
||||
advice_window->set_title("CatDog Advice");
|
||||
advice_window->resize(225, 50);
|
||||
advice_window->set_frameless(true);
|
||||
|
|
|
@ -63,7 +63,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-eyes"sv));
|
||||
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("Eyes");
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
window->resize(75 * (full_rows > 0 ? max_in_row : extra_columns), 100 * (full_rows + (extra_columns > 0 ? 1 : 0)));
|
||||
|
|
|
@ -191,7 +191,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_double_buffering_enabled(true);
|
||||
window->set_title("LibGfx Demo");
|
||||
window->set_resizable(false);
|
||||
|
|
|
@ -111,7 +111,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("LibGfx Scale Demo");
|
||||
window->set_resizable(false);
|
||||
window->resize(WIDTH * 2, HEIGHT * 3);
|
||||
|
|
|
@ -405,7 +405,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(unveil(nullptr, nullptr));
|
||||
#endif
|
||||
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_double_buffering_enabled(false);
|
||||
window->set_title("Mandelbrot");
|
||||
window->set_obey_widget_min_size(false);
|
||||
|
|
|
@ -24,7 +24,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-model-gallery"sv));
|
||||
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("Model Gallery");
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
window->resize(430, 480);
|
||||
|
|
|
@ -72,7 +72,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto app_icon = GUI::Icon::default_icon("app-screensaver"sv);
|
||||
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("Screensaver");
|
||||
window->resize(360, 240);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-widget-gallery"sv));
|
||||
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
auto window = GUI::Window::construct();
|
||||
window->resize(430, 480);
|
||||
window->set_title("Widget Gallery");
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue