- Move to libglademm to handle GUI creation. This is experimental,
but should greatly help in reducing development times git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@727 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
3dd8403f0a
commit
41d20ba6eb
5 changed files with 44 additions and 17 deletions
|
@ -24,7 +24,7 @@
|
|||
#include "main.hh"
|
||||
|
||||
#include "parse_opts.hh"
|
||||
// #include "start_gui.hh"
|
||||
#include "start_gui.hh"
|
||||
|
||||
#include "backend/plugin_manager.hh"
|
||||
|
||||
|
@ -66,5 +66,7 @@ main(int argc, char* argv[])
|
|||
// Initializes plugin system
|
||||
PluginManager::get_instance();
|
||||
|
||||
start_gui(argc, argv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -21,24 +21,39 @@
|
|||
#include "config.h"
|
||||
#include "gettext.h"
|
||||
|
||||
#include "graphical_terminal_io.hh"
|
||||
#include "start_gui.hh"
|
||||
#include "smartp.tcc"
|
||||
|
||||
#include <libglademm/xml.h>
|
||||
#include <gtkmm/main.h>
|
||||
#include <gtkmm/menuitem.h>
|
||||
#include <gtkmm/window.h>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
void
|
||||
start_gui(int argc, char** argv, TextSimulation& txt)
|
||||
start_gui(int argc, char** argv)
|
||||
{
|
||||
Gtk::Main gtk_main(argc, argv);
|
||||
using namespace Gnome;
|
||||
using namespace Gtk;
|
||||
|
||||
GraphicalTerminalIO* gt = new sgpem::GraphicalTerminalIO(&txt);
|
||||
memory::smart_ptr<sgpem::IOManager> main_window(gt);
|
||||
txt.add_io_device(main_window);
|
||||
Main gtk_main(argc, argv);
|
||||
|
||||
//print the initial status on each iomanager
|
||||
//txt.update();
|
||||
Glib::RefPtr<Glade::Xml> refXml =
|
||||
Glade::Xml::create(GLADEDIR "/main-window.glade");
|
||||
|
||||
Gtk::Main::run(*gt);
|
||||
Window* main_window = NULL;
|
||||
refXml->get_widget("MainWindow", main_window);
|
||||
assert(main_window != NULL);
|
||||
|
||||
// Connect extra signals (decide where to do this...
|
||||
// here -- ugly -- derive widgets and then use
|
||||
// Glade::Xml::get_widget_derived -- better --)
|
||||
MenuItem* file_quit = NULL;
|
||||
refXml->get_widget("Menu.File.Quit", file_quit);
|
||||
file_quit->signal_activate().connect(sigc::ptr_fun(&Main::quit));
|
||||
|
||||
main_window->show_all_children();
|
||||
|
||||
Main::run(*main_window);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,13 +23,10 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include "text_simulation.hh"
|
||||
|
||||
|
||||
/** \brief This function initialize and starts the whole GUI
|
||||
|
||||
*/
|
||||
void SG_DLLEXPORT start_gui(int argc, char** argv, TextSimulation& txt);
|
||||
void SG_DLLEXPORT start_gui(int argc, char** argv);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue