forked from bitspalter/DNS-Proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.cpp
30 lines (24 loc) · 1.15 KB
/
start.cpp
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
#include "C_App.hpp"
#include <gtkmm/application.h>
//////////////////////////////////////////////////////////////////////////////////
// [ on_command_line ]
//////////////////////////////////////////////////////////////////////////////////
namespace{
int on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine>& command_line,
Glib::RefPtr<Gtk::Application>& app){
app->activate(); // Without activate() the window won't be shown.
return(EXIT_SUCCESS);
}
} // anonymous namespace
//////////////////////////////////////////////////////////////////////////////////
// [ main ]
//////////////////////////////////////////////////////////////////////////////////
int main(int argc, char *argv[]){
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.dns-proxy",
Gio::APPLICATION_HANDLES_COMMAND_LINE |
Gio::APPLICATION_NON_UNIQUE);
app->signal_command_line().connect(sigc::bind(sigc::ptr_fun(&on_command_line), app), false);
C_App CApp(argc, argv);
//Shows the window and returns when it is closed.
return(app->run(CApp));
}