main.cpp 964 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2021, sin-ack <sin-ack@protonmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include "GalleryWidget.h"
  7. #include <LibCore/System.h>
  8. #include <LibGUI/Application.h>
  9. #include <LibGUI/BoxLayout.h>
  10. #include <LibGUI/Button.h>
  11. #include <LibGUI/Frame.h>
  12. #include <LibGUI/MessageBox.h>
  13. #include <LibMain/Main.h>
  14. #include <unistd.h>
  15. ErrorOr<int> serenity_main(Main::Arguments arguments)
  16. {
  17. TRY(Core::System::pledge("stdio recvfd sendfd rpath wpath cpath unix"));
  18. auto app = TRY(GUI::Application::create(arguments));
  19. TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
  20. auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-model-gallery"sv));
  21. auto window = GUI::Window::construct();
  22. window->set_title("Model Gallery");
  23. window->set_icon(app_icon.bitmap_for_size(16));
  24. window->resize(430, 480);
  25. (void)TRY(window->set_main_widget<GalleryWidget>());
  26. window->show();
  27. return app->exec();
  28. }