1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:08:12 +00:00

GameOfLife: Add pledge and unveil

This commit is contained in:
Luke Wilde 2021-08-27 14:54:42 +01:00 committed by Ali Mohammad Pur
parent 7a0fbb94b6
commit 5d6fccc52b

View file

@ -18,12 +18,34 @@
#include <LibGUI/Toolbar.h>
#include <LibGUI/ToolbarContainer.h>
#include <LibGUI/Window.h>
#include <unistd.h>
const char* click_tip = "Tip: click the board to toggle individual cells, or click+drag to toggle multiple cells";
int main(int argc, char** argv)
{
if (pledge("stdio rpath recvfd sendfd unix", nullptr) < 0) {
perror("pledge");
return 1;
}
auto app = GUI::Application::construct(argc, argv);
if (pledge("stdio rpath recvfd sendfd", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;
}
auto app_icon = GUI::Icon::default_icon("app-gameoflife");
auto window = GUI::Window::construct();