From 87a84efbb0ccb19500ad18fcdba390d208b414eb Mon Sep 17 00:00:00 2001 From: david Date: Tue, 21 Jan 2003 02:09:27 +0000 Subject: [PATCH] Added support for reinit(), to reload the configuration files without having to restart FlightGear. This should speed up GUI design and debugging quite a bit. --- src/GUI/new_gui.cxx | 15 +++++++++++++++ src/GUI/new_gui.hxx | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index 2e9b4d560..a0e17a65e 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -42,6 +42,21 @@ NewGUI::init () #endif } +void +NewGUI::reinit () +{ + unbind(); + +#if !defined(FG_OLD_MENUBAR) + delete _menubar; + _menubar = new FGMenuBar; +#endif + _dialog_props.clear(); + + init(); + bind(); +} + void NewGUI::bind () { diff --git a/src/GUI/new_gui.hxx b/src/GUI/new_gui.hxx index 7936c8a17..2fd8909f4 100644 --- a/src/GUI/new_gui.hxx +++ b/src/GUI/new_gui.hxx @@ -54,6 +54,11 @@ public: */ virtual void init (); + /** + * Reinitialize the GUI subsystem. + */ + virtual void reinit (); + /** * Bind properties for the GUI subsystem. * -- 2.39.5