Fawkes API  Fawkes Development Version
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 # if GTKMM_VERSION_GE(2,20)
29 # define UI_FILE RESDIR"/guis/skillgui/skillgui_gtk2.ui"
30 # else
31 # define UI_FILE RESDIR"/guis/skillgui/skillgui_gtk2_nospinner.ui"
32 # endif
33 #endif
34 
35 /** This is the main program of the Skill GUI.
36  */
37 int
38 main(int argc, char **argv) {
39  Gtk::Main gtk_main(argc, argv);
40 #ifdef HAVE_GCONFMM
41  Gnome::Conf::init();
42 #endif
43 
44  try {
45  Glib::RefPtr<Gtk::Builder> builder =
46  Gtk::Builder::create_from_file(UI_FILE);
47 
48  SkillGuiGtkWindow *window = NULL;
49  builder->get_widget_derived("wnd_skillgui", window);
50 
51  Gtk::Main::run(*window);
52 
53  delete window;
54  } catch (Gtk::BuilderError &e) {
55  printf("Failed to instantiate window: %s\n", e.what().c_str());
56  }
57 
58  return 0;
59 }
Skill GUI main window.
Definition: skillgui.h:54