| 12
 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
 36
 37
 38
 39
 40
 41
 42
 43
 44
 
 |  
#include <gtkmm/main.h>
#include "main_window.h"
 
int main(int argc, char *argv[])
{
	Gtk::Main application(argc, argv);
	std::string sGladeFilename = "GtkDemo.glade";
 
	gtk_rc_parse("/home/tmp/gtk/themes/Aero-ion3.1/gtk-2.0/gtkrc");
 
	Glib::RefPtr<Gnome::Glade::Xml> refXml;
	//Load the Glade file and instantiate its widgets:
#ifdef GLIBMM_EXCEPTIONS_ENABLED
	try
	{
		refXml = Gnome::Glade::Xml::create(sGladeFilename);
	}
	catch(const Gnome::Glade::XmlError& ex)
	{
		std::cerr << ex.what() << std::endl;
	}
#else
	std::auto_ptr<Gnome::Glade::XmlError> error;
	refXml = Gnome::Glade::Xml::create(sGladeFilename, "", "", error);
	if(error.get())
	{
		std::cerr << error->what() << std::endl;
	}
#endif
 
	MainWindow* pMainWindow = 0;
 
	//On transforme la boîte de dialogue glade en MainWindow
	refXml->get_widget_derived("MainWindow", pMainWindow);
	if(pMainWindow)
	{
		application.run(*pMainWindow);
		delete(pMainWindow);
		pMainWindow = 0;
	}
 
	return 0;
} | 
Partager