Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
main.cpp
1 
2 /***************************************************************************
3  * main.cpp - Skill GUI main
4  *
5  * Created: Mon Nov 30 13:33:13 2008
6  * Copyright 2008 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #include "skillgui.h"
24 
25 #if GTK_VERSION_GE(3,0)
26 # define UI_FILE RESDIR"/guis/skillgui/skillgui.ui"
27 #else
28 # define UI_FILE RESDIR"/guis/skillgui/skillgui_gtk2.ui"
29 #endif
30 
31 /** This is the main program of the Skill GUI.
32  */
33 int
34 main(int argc, char **argv) {
35  Gtk::Main gtk_main(argc, argv);
36 #ifdef HAVE_GCONFMM
37  Gnome::Conf::init();
38 #endif
39 
40  try {
41  Glib::RefPtr<Gtk::Builder> builder =
42  Gtk::Builder::create_from_file(UI_FILE);
43 
44  SkillGuiGtkWindow *window = NULL;
45  builder->get_widget_derived("wnd_skillgui", window);
46 
47  Gtk::Main::run(*window);
48 
49  delete window;
50  } catch (Gtk::BuilderError &e) {
51  printf("Failed to instantiate window: %s\n", e.what().c_str());
52  }
53 
54  return 0;
55 }