-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (29 loc) · 982 Bytes
/
main.cpp
File metadata and controls
35 lines (29 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "MainWindow.hpp"
#include <gtkmm.h>
#include <iostream>
#include <memory>
int main(int argc, char *argv[])
{
auto app = Gtk::Application::create("com.aydinkasimoglu.cmtparser");
app->signal_activate().connect([&app]() {
try {
auto mainWindowController = std::make_shared<MainWindow>();
auto pWindow = mainWindowController->get_window();
if (pWindow) {
app->add_window(*pWindow);
pWindow->present();
pWindow->signal_close_request().connect(
[&app, mainWindowController]() -> bool {
app->quit();
return false;
},
false
);
}
}
catch(const std::exception& e) {
std::cerr << "An error occurred: " << e.what() << std::endl;
}
});
return app->run(argc, argv);
}