63 lines
1.6 KiB
C++
63 lines
1.6 KiB
C++
|
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
|
||
|
|
/*
|
||
|
|
* main.cc
|
||
|
|
* Copyright (C) Joel Holdsworth 2008 <joel@airwebreathe.org.uk>
|
||
|
|
*
|
||
|
|
* main.cc is free software.
|
||
|
|
*
|
||
|
|
* You may redistribute it and/or modify it under the terms of the
|
||
|
|
* GNU General Public License, as published by the Free Software
|
||
|
|
* Foundation; either version 2 of the License, or (at your option)
|
||
|
|
* any later version.
|
||
|
|
*
|
||
|
|
* main.cc is distributed in the hope that it will be useful,
|
||
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||
|
|
* See the GNU General Public License for more details.
|
||
|
|
*
|
||
|
|
* You should have received a copy of the GNU General Public License
|
||
|
|
* along with main.cc. If not, write to:
|
||
|
|
* The Free Software Foundation, Inc.,
|
||
|
|
* 51 Franklin Street, Fifth Floor
|
||
|
|
* Boston, MA 02110-1301, USA.
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include <libglademm/xml.h>
|
||
|
|
#include <gtkmm.h>
|
||
|
|
#include <iostream>
|
||
|
|
|
||
|
|
|
||
|
|
#ifdef ENABLE_NLS
|
||
|
|
# include <libintl.h>
|
||
|
|
#endif
|
||
|
|
|
||
|
|
|
||
|
|
/* For testing propose use the local (not installed) glade file */
|
||
|
|
/* #define GLADE_FILE PACKAGE_DATA_DIR"/gtk-lumiera/glade/gtk-lumiera.glade" */
|
||
|
|
#define GLADE_FILE "gtk-lumiera.glade"
|
||
|
|
|
||
|
|
int
|
||
|
|
main (int argc, char *argv[])
|
||
|
|
{
|
||
|
|
Gtk::Main kit(argc, argv);
|
||
|
|
|
||
|
|
//Load the Glade file and instiate its widgets:
|
||
|
|
Glib::RefPtr<Gnome::Glade::Xml> refXml;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
refXml = Gnome::Glade::Xml::create(GLADE_FILE);
|
||
|
|
}
|
||
|
|
catch(const Gnome::Glade::XmlError& ex)
|
||
|
|
{
|
||
|
|
std::cerr << ex.what() << std::endl;
|
||
|
|
return 1;
|
||
|
|
}
|
||
|
|
Gtk::Window* main_win = 0;
|
||
|
|
refXml->get_widget("main_window", main_win);
|
||
|
|
if (main_win)
|
||
|
|
{
|
||
|
|
kit.run(*main_win);
|
||
|
|
}
|
||
|
|
return 0;
|
||
|
|
}
|