mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
Demos: Use pledge and unveil
This commit is contained in:
parent
e8ff7c895b
commit
9faca895d3
8 changed files with 115 additions and 0 deletions
|
@ -175,6 +175,21 @@ int main(int argc, char** argv)
|
|||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto app_icon = GUI::Icon::default_icon("app-mouse");
|
||||
|
||||
if (pledge("stdio rpath shared_buffer", 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 window = GUI::Window::construct();
|
||||
window->set_title("Mouse button demo");
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue