mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 15:15:07 +00:00
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
#include "CalendarWidget.h"
|
|
#include <LibGUI/AboutDialog.h>
|
|
#include <LibGUI/Action.h>
|
|
#include <LibGUI/Application.h>
|
|
#include <LibGUI/Menu.h>
|
|
#include <LibGUI/MenuBar.h>
|
|
#include <LibGUI/Window.h>
|
|
#include <LibGfx/Bitmap.h>
|
|
#include <stdio.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
|
|
if (pledge("stdio shared_buffer rpath accept unix cpath fattr", nullptr) < 0) {
|
|
perror("pledge");
|
|
return 1;
|
|
}
|
|
|
|
GUI::Application app(argc, argv);
|
|
|
|
if (pledge("stdio shared_buffer rpath accept", nullptr) < 0) {
|
|
perror("pledge");
|
|
return 1;
|
|
}
|
|
|
|
if (unveil("/res", "r") < 0) {
|
|
perror("unveil");
|
|
return 1;
|
|
}
|
|
|
|
unveil(nullptr, nullptr);
|
|
|
|
auto window = GUI::Window::construct();
|
|
window->set_title("Calendar");
|
|
window->set_rect(20, 200, 596, 476);
|
|
//TODO: Allow proper resize
|
|
window->set_resizable(false);
|
|
|
|
window->set_main_widget<CalendarWidget>();
|
|
|
|
window->show();
|
|
|
|
auto menubar = make<GUI::MenuBar>();
|
|
|
|
auto app_menu = GUI::Menu::construct("Calendar");
|
|
app_menu->add_action(GUI::CommonActions::make_quit_action([](auto&) {
|
|
GUI::Application::the().quit(0);
|
|
return;
|
|
}));
|
|
menubar->add_menu(move(app_menu));
|
|
app.set_menubar(move(menubar));
|
|
|
|
app.exec();
|
|
}
|