Index: orxonox/trunk/src/Makefile.in
===================================================================
--- orxonox/trunk/src/Makefile.in	(revision 3422)
+++ orxonox/trunk/src/Makefile.in	(revision 3423)
@@ -121,4 +121,6 @@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CFLAGS = @CURL_CFLAGS@
+CURL_LIBS = @CURL_LIBS@
 CXX = @CXX@
 CXXDEPMODE = @CXXDEPMODE@
@@ -136,6 +138,12 @@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
+GTHREAD_LIBS = @GTHREAD_LIBS@
 GTK2_CFLAGS = @GTK2_CFLAGS@
 GTK2_LIBS = @GTK2_LIBS@
+HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
+HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
+HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
+HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
@@ -310,7 +318,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  src/Makefile
+	  $(AUTOMAKE) --gnu  src/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Index: orxonox/trunk/src/console/Makefile.in
===================================================================
--- orxonox/trunk/src/console/Makefile.in	(revision 3422)
+++ orxonox/trunk/src/console/Makefile.in	(revision 3423)
@@ -87,4 +87,6 @@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CFLAGS = @CURL_CFLAGS@
+CURL_LIBS = @CURL_LIBS@
 CXX = @CXX@
 CXXDEPMODE = @CXXDEPMODE@
@@ -102,6 +104,12 @@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
+GTHREAD_LIBS = @GTHREAD_LIBS@
 GTK2_CFLAGS = @GTK2_CFLAGS@
 GTK2_LIBS = @GTK2_LIBS@
+HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
+HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
+HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
+HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
@@ -195,7 +203,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/console/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/console/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  src/console/Makefile
+	  $(AUTOMAKE) --gnu  src/console/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Index: orxonox/trunk/src/gui/Makefile.am
===================================================================
--- orxonox/trunk/src/gui/Makefile.am	(revision 3422)
+++ orxonox/trunk/src/gui/Makefile.am	(revision 3423)
@@ -1,5 +1,5 @@
-AM_CXXFLAGS=$(GTK2_CFLAGS) $(MSBITFIELDS)
-#AM_LDFLAGS=$(GTK2_LIBS)
-LIBS=$(GTK2_LIBS)
+AM_CXXFLAGS=$(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
+#AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
+LIBS=$(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
 
 bin_PROGRAMS=gui
@@ -11,5 +11,6 @@
 	    orxonox_gui_flags.cc \
 	    orxonox_gui_banner.cc \
-	    orxonox_gui_keys.cc
+	    orxonox_gui_keys.cc \
+	    orxonox_gui_update.cc
 
 noinst_HEADERS=orxonox_gui.h \
@@ -20,5 +21,6 @@
 	    orxonox_gui_flags.h \
 	    orxonox_gui_banner.h \
-	    orxonox_gui_keys.h
+	    orxonox_gui_keys.h \
+	    orxonox_gui_update.h
 
 #  uncomment the following if orxonox requires the mathlibrary
Index: orxonox/trunk/src/gui/Makefile.in
===================================================================
--- orxonox/trunk/src/gui/Makefile.in	(revision 3422)
+++ orxonox/trunk/src/gui/Makefile.in	(revision 3423)
@@ -56,5 +56,6 @@
 	orxonox_gui_video.$(OBJEXT) orxonox_gui_audio.$(OBJEXT) \
 	orxonox_gui_exec.$(OBJEXT) orxonox_gui_flags.$(OBJEXT) \
-	orxonox_gui_banner.$(OBJEXT) orxonox_gui_keys.$(OBJEXT)
+	orxonox_gui_banner.$(OBJEXT) orxonox_gui_keys.$(OBJEXT) \
+	orxonox_gui_update.$(OBJEXT)
 gui_OBJECTS = $(am_gui_OBJECTS)
 gui_LDADD = $(LDADD)
@@ -69,4 +70,5 @@
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_gtk.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_keys.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_update.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_video.Po
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
@@ -94,4 +96,6 @@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CFLAGS = @CURL_CFLAGS@
+CURL_LIBS = @CURL_LIBS@
 CXX = @CXX@
 CXXDEPMODE = @CXXDEPMODE@
@@ -109,6 +113,12 @@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
+GTHREAD_LIBS = @GTHREAD_LIBS@
 GTK2_CFLAGS = @GTK2_CFLAGS@
 GTK2_LIBS = @GTK2_LIBS@
+HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
+HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
+HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
+HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
@@ -119,6 +129,6 @@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
-#AM_LDFLAGS=$(GTK2_LIBS)
-LIBS = $(GTK2_LIBS)
+#AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
+LIBS = $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
@@ -180,5 +190,5 @@
 target_os = @target_os@
 target_vendor = @target_vendor@
-AM_CXXFLAGS = $(GTK2_CFLAGS) $(MSBITFIELDS)
+AM_CXXFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
 gui_SOURCES = orxonox_gui.cc \
 	    orxonox_gui_gtk.cc \
@@ -188,5 +198,6 @@
 	    orxonox_gui_flags.cc \
 	    orxonox_gui_banner.cc \
-	    orxonox_gui_keys.cc
+	    orxonox_gui_keys.cc \
+	    orxonox_gui_update.cc
 
 noinst_HEADERS = orxonox_gui.h \
@@ -197,5 +208,6 @@
 	    orxonox_gui_flags.h \
 	    orxonox_gui_banner.h \
-	    orxonox_gui_keys.h
+	    orxonox_gui_keys.h \
+	    orxonox_gui_update.h
 
 
@@ -222,7 +234,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/gui/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/gui/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  src/gui/Makefile
+	  $(AUTOMAKE) --gnu  src/gui/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -282,4 +294,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_gtk.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_keys.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_update.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_video.Po@am__quote@
 
Index: orxonox/trunk/src/gui/orxonox_gui.cc
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui.cc	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui.cc	(revision 3423)
@@ -24,4 +24,6 @@
 */
 
+#include <unistd.h>
+
 #include "orxonox_gui.h"
 #include "orxonox_gui_video.h"
@@ -31,4 +33,5 @@
 #include "orxonox_gui_banner.h"
 #include "orxonox_gui_keys.h"
+#include "orxonox_gui_update.h"
 
   Window* orxonoxGUI;
@@ -39,6 +42,8 @@
   OrxonoxGuiBanner* banner;
   OrxonoxGuiKeys* keys;
+  OrxonoxGuiUpdate* update;
+int verbose = 4;
 
-int main( int argc, char *argv[] )
+int main(int argc, char *argv[])
 {
   OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv);
@@ -51,14 +56,9 @@
    \brief Initializes the Gui
 */
-OrxonoxGui::OrxonoxGui (int argc, char *argv[])
+OrxonoxGui::OrxonoxGui(int argc, char *argv[])
 {
-#ifdef HAVE_GTK2
-  initGTK(argc, argv);
-#endif /* HAVE_GTK2 */
-  orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION);
-#ifdef HAVE_GTK2
-  orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit);
-  orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit);
-#endif /* HAVE_GTK2 */
+  initGUI(argc, argv);
+
+  orxonoxGUI = new Window( "grafical orxonox loader, "PACKAGE_VERSION);
   
   Box* windowBox = new Box ('h');
@@ -67,50 +67,73 @@
   windowBox->fill (banner->getWidget());
   
-  Box* optionBox = new Box ('v');
+  Box* optionBox = new Box('v');
   
-  Box* avBox = new Box ('h');
+  Box* avBox = new Box('h');
 
-  video = new OrxonoxGuiVideo ();
-  avBox->fill (video->getWidget ());
-  audio = new OrxonoxGuiAudio ();
-  avBox->fill (audio->getWidget ());
+  video = new OrxonoxGuiVideo();
+  avBox->fill(video->getWidget());
+  audio = new OrxonoxGuiAudio();
+  avBox->fill(audio->getWidget());
       
-  optionBox->fill (avBox);
+  optionBox->fill(avBox);
 
-  keys = new OrxonoxGuiKeys ();
-  optionBox->fill (keys->getWidget ());
+  keys = new OrxonoxGuiKeys();
+  optionBox->fill(keys->getWidget());
 
-  exec = new OrxonoxGuiExec (orxonoxGUI);
-  optionBox->fill (exec->getWidget ());
+  exec = new OrxonoxGuiExec();
+  optionBox->fill(exec->getWidget());
 
-  flags = new OrxonoxGuiFlags (orxonoxGUI);
+  flags = new OrxonoxGuiFlags();
+
+  optionBox->fill(flags->getWidget());
+  windowBox->fill(optionBox);
+
+  update = new OrxonoxGuiUpdate();
+  optionBox->fill(update->getWidget());
+  
+  orxonoxGUI->fill(windowBox);
+
+  // Reading Values from File
+  exec->setFilename("~/.orxonox.conf");
+  exec->readFromFile(orxonoxGUI);
+  // Merging changes to the Options from appended flags.
+  for (int optCount = 1; optCount < argc; optCount++)
+    orxonoxGUI->walkThrough(Widget::flagCheck, argv[optCount], 0);
+
+  flags->setTextFromFlags(orxonoxGUI);
+  orxonoxGUI->showall();
+
+  //// Handling special Cases. ///
+
+  // case update //
+#ifdef HAVE_CURL
+  if (static_cast<Option*>(orxonoxGUI->findWidgetByName("auto update", 0))->value == 1)
+    {
+      update->checkForUpdates();
+    }
+#endif /* HAVE_CURL */
+
+  // case start-with-gui.
+  if (!access(exec->getConfigFile(), F_OK) && static_cast<Option*>(orxonoxGUI->findWidgetByName("Always Show this Menu", 0))->value == 0)
+    OrxonoxGuiExec::startOrxonox(NULL, exec);
+  else
+    {
+      mainloopGUI();
+    }
+
+}
 
 
-  optionBox->fill (flags->getWidget ());
-  windowBox->fill (optionBox);
-  
-  orxonoxGUI->fill (windowBox);
-  flags->setTextFromFlags (orxonoxGUI);
-
-  exec->setFilename ("~/.orxonox.conf");
-  exec->readFromFile (orxonoxGUI);
-  //  orxonoxGUI->walkThrough(orxonoxGUI->listOptions);
-
-  orxonoxGUI->showall ();
-
-  
-#ifdef HAVE_GTK2
-  mainloopGTK();
-#else /* HAVE_GTK2 */
-  cout << " Listing all the Orxonox Options: \n";
-  cout << "  #############################\n";
-  orxonoxGUI->walkThrough(orxonoxGUI->listOptions);
-
-  cout << "\nDo you want me to save the the above values now? [Yn] ";
-  char c = getchar();
-  if ((c == 'y' || c == 'Y' || c== 10) && exec->shouldsave())
-    exec->writeToFile (Window::mainWindow);
- 
-#endif /* HAVE_GTK2 */
-
+/**
+   \brief Destructor.
+*/
+OrxonoxGui::~OrxonoxGui(void)
+{
+  delete video;
+  delete audio;
+  delete exec;
+  delete flags;
+  delete banner;
+  delete keys;
+  delete update;
 }
Index: orxonox/trunk/src/gui/orxonox_gui.h
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui.h	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui.h	(revision 3423)
@@ -25,10 +25,8 @@
 {
  public:
-  OrxonoxGui (int argc, char *argv[]);
-  ~OrxonoxGui ();
+  OrxonoxGui(int argc, char *argv[]);
+  ~OrxonoxGui(void);
 
 };
 
-
-
 #endif /* _ORXONOX_GUI_H */
Index: orxonox/trunk/src/gui/orxonox_gui_audio.cc
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_audio.cc	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_audio.cc	(revision 3423)
@@ -29,28 +29,36 @@
    \brief Creates an Audio-Frame
 */
-OrxonoxGuiAudio::OrxonoxGuiAudio ()
+OrxonoxGuiAudio::OrxonoxGuiAudio(void)
 {
-  audioFrame = new Frame ("Audio-Options:");
-  audioBox = new Box ('v');
-  audioFrame->setGroupName ("audio");
+  this->audioFrame = new Frame("Audio-Options:");
+  this->audioBox = new Box('v');
+  this->audioFrame->setGroupName("audio");
   
-  enableSound = new CheckButton ("Disable Sound");
-  enableSound->setFlagName ("no-sound", 0);
-  enableSound->saveable = true;
-  audioBox->fill (enableSound);
-  Label* musicVolumeLabel = new Label ("Music Volume");
-  audioBox->fill (musicVolumeLabel);
-  musicVolume = new Slider ("Music Volume", 0, 100);
-  musicVolume->setFlagName ("music-volume", "m", 80);
-  musicVolume->saveable = true;
-  audioBox->fill (musicVolume);
+  this->enableSound = new CheckButton("Disable Sound");
+  this->enableSound->setFlagName ("no-sound", 0);
+  this->enableSound->saveability();
+  this->audioBox->fill(this->enableSound);
+  Label* musicVolumeLabel = new Label("Music Volume");
+  this->audioBox->fill(musicVolumeLabel);
+  this->musicVolume = new Slider("Music Volume", 0, 100);
+  this->musicVolume->setFlagName("music-volume", "m", 80);
+  this->musicVolume->saveability();
+  this->audioBox->fill (this->musicVolume);
   Label* effectsVolumeLabel = new Label ("Effects Volume");
-  audioBox->fill (effectsVolumeLabel);
-  effectsVolume = new Slider ("Effects Volume", 0, 100);
-  effectsVolume->setFlagName ("effects-volume", "e", 80);
-  effectsVolume->saveable = true;
-  audioBox->fill (effectsVolume);
+  this->audioBox->fill (effectsVolumeLabel);
+  this->effectsVolume = new Slider ("Effects Volume", 0, 100);
+  this->effectsVolume->setFlagName ("effects-volume", "e", 80);
+  this->effectsVolume->saveability();
+  this->audioBox->fill (this->effectsVolume);
 
-  audioFrame->fill (audioBox);
+  this->audioFrame->fill (this->audioBox);
+}
+
+/** 
+    \brief Destructs the Audio-Stuff
+*/
+OrxonoxGuiAudio::~OrxonoxGuiAudio(void)
+{
+  // nothing to do here.
 }
 
@@ -59,6 +67,6 @@
    \return Returns the Audio-frame
 */
-Widget* OrxonoxGuiAudio::getWidget ()
+Widget* OrxonoxGuiAudio::getWidget(void)
 {
-  return audioFrame;
+  return this->audioFrame;
 }
Index: orxonox/trunk/src/gui/orxonox_gui_audio.h
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_audio.h	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_audio.h	(revision 3423)
@@ -19,8 +19,8 @@
   Slider* effectsVolume;    //!< A Slider for effects volume.
  public:
-  OrxonoxGuiAudio ();
-  ~OrxonoxGuiAudio ();
+  OrxonoxGuiAudio(void);
+  ~OrxonoxGuiAudio(void);
   
-  Widget* getWidget ();
+  Widget* getWidget(void);
 };
 #endif /* _ORXONOX_GUI_AUDIO_H */
Index: orxonox/trunk/src/gui/orxonox_gui_banner.cc
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_banner.cc	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_banner.cc	(revision 3423)
@@ -29,35 +29,35 @@
    \brief Creates a new BannerEventBox and its content.
 */
-OrxonoxGuiBanner::OrxonoxGuiBanner ()
+OrxonoxGuiBanner::OrxonoxGuiBanner(void)
 {
   // Banner Itself //
-  bannerEventBox = new EventBox ("BannerEventBox");
-  bannerImage = new Image ("banner.xpm");
-  bannerEventBox->fill(bannerImage);
+  this->bannerEventBox = new EventBox("BannerEventBox");
+  this->bannerImage = new Image("banner.xpm");
+  this->bannerEventBox->fill(this->bannerImage);
 
   // Banner Window //
-  logoWindow = new Window("Logo");
+  this->logoWindow = new Window("Logo");
 
 #ifdef HAVE_GTK2
-  bannerEventBox->connectSignal ("button_press_event", logoWindow, Window::windowOpen);
+  this->bannerEventBox->connectSignal("button_press_event", this->logoWindow, Window::windowOpen);
 
-  logoWindow->connectSignal("destroy", logoWindow, Window::windowClose);
-  logoWindow->connectSignal("delete_event", logoWindow, Window::windowClose);
+  this->logoWindow->connectSignal("destroy", this->logoWindow, Window::windowClose);
+  this->logoWindow->connectSignal("delete_event", this->logoWindow, Window::windowClose);
 #endif /* HAVE_GTK2 */
-  logoEventBox = new EventBox();
-  logoBox = new Box('v');
-  logoLabel = new Label("OrxOnoX, Version: " PACKAGE_VERSION);
-  logoImage = new Image("banner.xpm");
-  logoEventBox->fill(logoImage);
+  this->logoEventBox = new EventBox();
+  this->logoBox = new Box('v');
+  this->logoLabel = new Label("OrxOnoX, Version: " PACKAGE_VERSION);
+  this->logoImage = new Image("banner.xpm");
+  this->logoEventBox->fill(this->logoImage);
   
-  logoBox->fill(logoLabel);
-  logoBox->fill(logoEventBox);
+  this->logoBox->fill(this->logoLabel);
+  this->logoBox->fill(this->logoEventBox);
 #ifdef HAVE_GTK2
-  logoEventBox->connectSignal("button_press_event",logoWindow, Window::windowClose);
+  this->logoEventBox->connectSignal("button_press_event", this->logoWindow, Window::windowClose);
 #endif /* HAVE_GTK2 */
 
-  logoWindow->fill (logoBox);
+  this->logoWindow->fill(this->logoBox);
   
-  Window::addWindow (logoWindow);
+  Window::addWindow(this->logoWindow);
 }
 
@@ -65,6 +65,7 @@
    \brief Destructs it.
 */
-OrxonoxGuiBanner::~OrxonoxGuiBanner ()
+OrxonoxGuiBanner::~OrxonoxGuiBanner(void)
 {
+  // nothing to do here
 }
 
@@ -73,7 +74,7 @@
    \return The EventBox, that holds the Banner.
 */
-Widget* OrxonoxGuiBanner::getWidget ()
+Widget* OrxonoxGuiBanner::getWidget(void)
 {
-  return bannerEventBox;
+  return this->bannerEventBox;
 }
 
Index: orxonox/trunk/src/gui/orxonox_gui_banner.h
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_banner.h	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_banner.h	(revision 3423)
@@ -29,8 +29,8 @@
 
  public:
-  OrxonoxGuiBanner ();
-  ~OrxonoxGuiBanner ();
+  OrxonoxGuiBanner(void);
+  ~OrxonoxGuiBanner(void);
 
-  Widget* getWidget ();
+  Widget* getWidget(void);
 
 };
Index: orxonox/trunk/src/gui/orxonox_gui_exec.cc
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_exec.cc	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_exec.cc	(revision 3423)
@@ -28,40 +28,52 @@
 #include <string>
 
+HashTable* orxonoxFlagHash;
+
 /** 
     \brief Creates the Exec-Frame
-    \param orxonoxGUI ExecFrame needs to know where to get the Options from
-*/
-OrxonoxGuiExec::OrxonoxGuiExec (Window* orxonoxGUI)
-{
-  configFile = (char*)malloc (512*sizeof (char));
-
-  execFrame = new Frame ("Execute-Tags:");
-  execBox = new Box ('v');
-  execFrame->setGroupName ("misc");
+*/
+OrxonoxGuiExec::OrxonoxGuiExec(void)
+{
+  configFile =(char*)malloc(512*sizeof(char));
+
+  this->execFrame = new Frame("Execute-Tags:");
+  this->execBox = new Box('v');
+  this->execFrame->setGroupName("misc");
   
-  start = new Button ("Start");
+  this->start = new Button("Start");
 #ifdef HAVE_GTK2
-  start->connectSignal ("clicked", startOrxonox);
+  this->start->connectSignal("clicked", this, startOrxonox);
 #endif /* HAVE_GTK2 */
-  execBox->fill (start);
-  saveSettings = new CheckButton ("Save Settings");
-  saveSettings->value = 1;
-  saveSettings->saveable = true;
-  execBox->fill (saveSettings);
-  verboseMode = new Menu ("verbose mode", "no output", "verbose", "debug", "lastItem");
-  verboseMode->setFlagName ("verbose", "v", 0);
-  verboseMode->saveable = true;
-  execBox->fill (verboseMode);
-  alwaysShow = new CheckButton ("Always Show this Menu");
-  alwaysShow->setFlagName ("gui", "g", 0);
-  alwaysShow->saveable = true;
-  execBox->fill (alwaysShow);
-  quit = new Button ("Quit");
+  this->execBox->fill(start);
+  this->saveSettings = new CheckButton("Save Settings");
+  this->saveSettings->value = 1;
+  this->saveSettings->saveability();
+  this->execBox->fill(this->saveSettings);
+  this->verboseMode = new Menu("verbose mode", "no output", "error", "warning", "info", "lastItem");
+  this->verboseMode->setFlagName("verbose", "v", 0);
+  this->verboseMode->saveability();
+  this->execBox->fill(this->verboseMode);
+  this->alwaysShow = new CheckButton("Always Show this Menu");
+  this->alwaysShow->setFlagName("gui", "g", 0);
+  this->alwaysShow->saveability();
+  this->execBox->fill(this->alwaysShow);
+  this->quit = new Button("Quit");
 #ifdef HAVE_GTK2
-  quit->connectSignal ("clicked", orxonoxGUI->orxonox_gui_quit);
+  this->quit->connectSignal("clicked", this, OrxonoxGuiExec::quitOrxonox);
+  //  Window::mainWindow->connectSignal("remove", this, OrxonoxGuiExec::quitOrxonox);
+  Window::mainWindow->connectSignal("destroy", this, OrxonoxGuiExec::quitOrxonox);
 #endif /* HAVE_GTK2 */
-  execBox->fill (quit);
-
-  execFrame->fill (execBox);
+  this->execBox->fill(this->quit);
+
+  this->execFrame->fill(this->execBox);
+}
+
+/**
+   \brief Destructs the Execution-stuff
+*/
+OrxonoxGuiExec::~OrxonoxGuiExec(void)
+{
+  if(this->configFile)
+    delete []this->configFile;
 }
 
@@ -70,5 +82,5 @@
    \return Returns the Exec-frame
 */
-Widget* OrxonoxGuiExec::getWidget ()
+Widget* OrxonoxGuiExec::getWidget(void)
 {
   return execFrame;
@@ -78,23 +90,34 @@
 
 /**
-   \brief Sets the location of the configuration File.\n
-   * The name will be parsed from ~/ to /home/[username] on unix and c:/Documents and Settings/username/Settings/ on Windows
+   \brief Sets the location of the configuration File.
    \param filename the location of the configFile
-*/
-void OrxonoxGuiExec::setFilename (char* filename)
-{
-  char* buffer = (char*) malloc (512*sizeof(buffer));
-  sprintf (buffer, "%s", filename);
-  if (!strncmp (buffer, "~/", 2))
+
+   \todo: memory allocation could be better.
+
+   The name will be parsed from ~/ to /home/[username] on unix and c:/Documents and Settings/username/Settings/ on Windows
+*/
+void OrxonoxGuiExec::setFilename(char* filename)
+{
+  char* buffer = (char*)malloc(2048*sizeof(char));
+  sprintf(buffer, "%s", filename);
+  if(!strncmp(buffer, "~/", 2))
   {
 #ifdef __WIN32__
-    sprintf (configFile, "%s/%s", getenv ("USERPROFILE"), buffer+2);
+    sprintf(configFile, "%s/%s", getenv("USERPROFILE"), buffer+2);
 #else
-    sprintf (configFile, "%s/%s", getenv ("HOME"), buffer+2);
+    sprintf(configFile, "%s/%s", getenv("HOME"), buffer+2);
 #endif
   }
-  else if (buffer)
-    sprintf(configFile, "%s", buffer);
-  delete buffer;
+  else if(buffer)
+    strcpy(this->configFile, buffer);
+  free (buffer);
+}
+
+/**
+   \returns The name of the Configuration-File
+*/
+char* OrxonoxGuiExec::getConfigFile(void)
+{
+  return this->configFile;
 }
 
@@ -103,7 +126,7 @@
    \return 1 if it should 0 if not/
 */
-int OrxonoxGuiExec::shouldsave ()
-{
-  return (static_cast<Option*>(saveSettings)->value);
+int OrxonoxGuiExec::shouldsave()
+{
+  return(static_cast<Option*>(this->saveSettings)->value);
 }
 
@@ -112,12 +135,12 @@
     \param widget from which Widget on should be saved.
 
-    this Function only opens and closes the file, in between OrxonoxGuiExec::writeFileText (Widget* widget) will execute the real writing process.
-*/
-void OrxonoxGuiExec::writeToFile (Widget* widget)
-{
-  CONFIG_FILE = fopen (configFile, "w");
-  if (CONFIG_FILE)
-    writeFileText (widget, 0);
-  fclose (CONFIG_FILE);
+    this Function only opens and closes the file, in between OrxonoxGuiExec::writeFileText(Widget* widget) will execute the real writing process.
+*/
+void OrxonoxGuiExec::writeToFile(Widget* widget)
+{
+  this->CONFIG_FILE = fopen(configFile, "w");
+  if(this->CONFIG_FILE)
+    this->writeFileText(widget, 0);
+  fclose(this->CONFIG_FILE);
 }
 
@@ -127,52 +150,52 @@
    \param depth initially "0", and grows higher, while new Groups are bundeled.
 */
-void OrxonoxGuiExec::writeFileText (Widget* widget, int depth)
+void OrxonoxGuiExec::writeFileText(Widget* widget, int depth)
 {
   int counter = 0;
-  while (counter < depth && ((widget->isOption>0
-			      && (static_cast<Option*>(widget)->saveable) )
-			     || (widget->isOption<0
-				 && static_cast<Packer*>(widget)->getGroupName())))
-    {
-      fprintf (CONFIG_FILE, "  ", depth);
+  while(counter < depth &&((widget->isOption>0
+			      &&(static_cast<Option*>(widget)->isSaveable()))
+			     ||(widget->isOption<0
+				&& static_cast<Packer*>(widget)->getGroupName())))
+    {
+      fprintf(this->CONFIG_FILE, "  ", depth);
       counter++;
     }
   
   // check if it is a Packer, and if it is, check if it has a name and if there is something in it.
-  if (widget->isOption <0)
-    {
-      if (static_cast<Packer*>(widget)->getGroupName())
-	{
-	  fprintf (CONFIG_FILE, "[%s]\n", static_cast<Packer*>(widget)->getGroupName());
-	  writeFileText (static_cast<Packer*>(widget)->down, depth+1);
+  if(widget->isOption <0)
+    {
+      if(static_cast<Packer*>(widget)->getGroupName())
+	{
+	  fprintf(CONFIG_FILE, "[%s]\n", static_cast<Packer*>(widget)->getGroupName());
+	  this->writeFileText(static_cast<Packer*>(widget)->down, depth+1);
 	  fprintf(CONFIG_FILE, "\n");
 	}
       else
 	{
-	  writeFileText (static_cast<Packer*>(widget)->down, depth);
+	  this->writeFileText(static_cast<Packer*>(widget)->down, depth);
 	}
     } 
-  //  if (widget->isOption == 0)
-  //    printf ("%s\n",widget->label);
-  if (widget->isOption >= 1)
-    if  (static_cast<Option*>(widget)->saveable)
+  //  if(widget->isOption == 0)
+  //    printf("%s\n",widget->title);
+  if(widget->isOption >= 1)
+    if (static_cast<Option*>(widget)->isSaveable())
       {
 	char Buffer[256];
 	char* space2under;
-	strcpy (Buffer, static_cast<Option*>(widget)->label);
-	if (strchr (Buffer, '_'))
+	strcpy(Buffer, static_cast<Option*>(widget)->title);
+	if(strchr(Buffer, '_'))
 	  cout << "Warning Optionname" << Buffer << " is not Valid for Saving, because it includes an underscore" << endl;
-	while (space2under = strchr(Buffer, ' '))
+	while(space2under = strchr(Buffer, ' '))
 	  {
 	    space2under[0] = '_';
 	  }
-	if (widget->isOption <=3)
-	  fprintf (CONFIG_FILE, "%s = %d\n", Buffer, static_cast<Option*>(widget)->value);
-	else if (widget->isOption == 5)
-	  fprintf (CONFIG_FILE, "%s = %s\n", Buffer, static_cast<OptionLabel*>(widget)->cValue);
+	if(widget->isOption <=3)
+	  fprintf(CONFIG_FILE, "%s = %d\n", Buffer, static_cast<Option*>(widget)->value);
+	else if(widget->isOption == 5)
+	  fprintf(CONFIG_FILE, "%s = %s\n", Buffer, static_cast<OptionLabel*>(widget)->cValue);
       }
 
-  if (widget->next != NULL)
-    writeFileText (widget->next, depth);
+  if(widget->next != NULL)
+    this->writeFileText(widget->next, depth);
 }
 
@@ -181,8 +204,9 @@
    \param widget from which Widget on should be saved.
 */
-void OrxonoxGuiExec::readFromFile (Widget* widget)
-{
-  CONFIG_FILE = fopen (configFile, "r");
-  if (CONFIG_FILE)
+void OrxonoxGuiExec::readFromFile(Widget* widget)
+{
+  this->CONFIG_FILE = fopen(configFile, "r");
+  VarInfo varInfo;
+  if(this->CONFIG_FILE)
     {
       Widget* groupWidget = widget;
@@ -190,60 +214,57 @@
       char Variable[256]= "";
       char* Value;
-      while (fscanf (CONFIG_FILE, "%s", Buffer) != EOF)
+      while(fscanf(this->CONFIG_FILE, "%s", Buffer) != EOF)
 	{
 	  // group-search //
-	  if (!strncmp (Buffer, "[", 1))
+	  if(!strncmp(Buffer, "[", 1))
 	    {
-	      if ((groupWidget = locateGroup (widget, Buffer, 1))==NULL)
+	      if((groupWidget = locateGroup(widget, Buffer, 1))==NULL)
 		{
 		  cout << "!!There is no group called " << Buffer << " in this GUI.\n First best Widget will get the Infos assigned.\n Config-File will be updated in next Save\n";
 		  groupWidget = widget;
 		}
+	      else
+		PRINT(3)("Group %s located.\n", static_cast<Packer*>(groupWidget)->groupName);
 	    }
 	  // option-setting //
-	  if (!strcmp (Buffer, "="))
+	  if(!strcmp(Buffer, "="))
 	    {
 	      char* under2space;
-	      while (under2space = strchr(Variable, '_'))
+	      while(under2space = strchr(Variable, '_'))
 		{
-		  sprintf (under2space, " %s", under2space+1);
+		  sprintf(under2space, " %s", under2space+1);
 		}
 	      
-	      fscanf (CONFIG_FILE, "%s", Buffer);
-	      Value = Buffer;
-	      readFileText (groupWidget, Variable, Value, 0);
-	      sprintf (Variable, "");
+	      fscanf(this->CONFIG_FILE, "%s", Buffer);
+	      varInfo.variableName = Variable;
+	      varInfo.variableValue = Buffer;
+	      groupWidget->walkThrough(this->readFileText, &varInfo, 0);
+	      sprintf(Variable, "");
 	    }
-	  sprintf (Variable, "%s", Buffer);
-	}
-      widget->walkThrough(widget->setOptions);
-    }
-}
+	  sprintf(Variable, "%s", Buffer);
+	}
+      widget->walkThrough(widget->setOptions, 0);
+    }
+}
+
 /**
    \brief Maps Confugurations to the Options.
    \param widget which widget downwards
-   \param variableName the name of the Variable that should be set up.
-   \param variableValue the Value of the Variable that should be set up
-   \param depth the depth of the local Widget
-*/
-void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, char* variableValue, int depth)
-{
-  if (widget->isOption >= 1 && widget->isOption <= 3)
-    {
-      if (!strcmp (static_cast<Option*>(widget)->label, variableName))
-	static_cast<Option*>(widget)->value = atoi(variableValue);
-    }
-  else if (widget->isOption == 5)
-    {
-       if (!strcmp (static_cast<Option*>(widget)->label, variableName))
-	static_cast<OptionLabel*>(widget)->setValue(variableValue);
-    }
-  if (widget->isOption < 0)
-    {
-      readFileText (static_cast<Packer*>(widget)->down, variableName, variableValue, depth+1);
-    } 
-
-  if (widget->next != NULL && depth !=0)
-    readFileText (widget->next, variableName, variableValue, depth);
+   \param varInfo Information about the Variable to read
+*/
+void OrxonoxGuiExec::readFileText(Widget* widget, void* varInfo)
+{
+  VarInfo* info =(VarInfo*)varInfo;
+  if(widget->title && !strcmp(widget->title, info->variableName))
+    {
+      PRINT(3)("Located Option %s.\n", widget->title);
+      if(widget->isOption >= 1 && widget->isOption <= 3)
+	{
+	  static_cast<Option*>(widget)->value = atoi(info->variableValue);
+	  static_cast<Option*>(widget)->redraw(); //!< \todo change this to setValue.
+	}
+      else if(widget->isOption == 5)
+	static_cast<OptionLabel*>(widget)->setValue(info->variableValue);
+    }
 }
 
@@ -254,4 +275,6 @@
    \param depth The Depth of the search seen from the first widget we searched from.
    \returns The Widget that holds the Group, or the NULL if the Group wasn't found.
+
+   \todo do this in gui-gtk.
 */
 Widget* OrxonoxGuiExec::locateGroup(Widget* widget, char* groupName, int depth)
@@ -260,5 +283,5 @@
 
   // removes the trailing and ending [ ].
-  if (!strncmp (groupName, "[", 1))
+  if(!strncmp(groupName, "[", 1))
     {
       groupName = groupName+1;
@@ -266,7 +289,7 @@
     }
 
-  if (widget->isOption < 0)
-    {
-      if (static_cast<Packer*>(widget)->getGroupName() && !strcmp(groupName, static_cast<Packer*>(widget)->getGroupName()))
+  if(widget->isOption < 0)
+    {
+      if(static_cast<Packer*>(widget)->getGroupName() && !strcmp(groupName, static_cast<Packer*>(widget)->getGroupName()))
 	{
 	  return widget;
@@ -274,12 +297,12 @@
       else
 	{
-	  if ((tmp = locateGroup (static_cast<Packer*>(widget)->down, groupName, depth+1)) != NULL)
+	  if((tmp = locateGroup(static_cast<Packer*>(widget)->down, groupName, depth+1)) != NULL)
 	    return tmp;
 	}
     } 
   
-  if (widget->next != NULL && depth != 0)
-    {
-      if ((tmp = locateGroup (widget->next, groupName, depth)) != NULL)
+  if(widget->next != NULL && depth != 0)
+    {
+      if((tmp = locateGroup(widget->next, groupName, depth)) != NULL)
 	return tmp;
     }
@@ -289,12 +312,63 @@
 #ifdef HAVE_GTK2
 /**
-   \brief Starts ORXONOX. (not really implemented yet, but the function is there.\n
-   This is a Signal and can be executed through Widget::signal_connect
+   \brief Starts ORXONOX.(not really implemented yet, but the function is there.\n
    \param widget the widget that executed the start command
    \param data additional data
-*/
-gint startOrxonox (GtkWidget *widget, Widget* data)
-{
+
+   This is a Signal and can be executed through Widget::signal_connect
+*/
+int OrxonoxGuiExec::startOrxonox(GtkWidget* widget, void* data)
+{
+  OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
+  if(exec->shouldsave())
+    exec->writeToFile(Window::mainWindow);
   cout << "Starting Orxonox" <<endl;
-}
+  gtk_main_quit();
+  system("cd ..;./orxonox"); //!< \todo fix this. should execute orxonox for real(coded not over the shell)
+}
+
+/**
+   \brief Starts ORXONOX.(not really implemented yet, but the function is there.\n
+   \param widget the widget that executed the start command
+   \param data additional data
+
+   This is a Signal and can be executed through Widget::signal_connect
+*/
+int OrxonoxGuiExec::quitOrxonox(GtkWidget* widget, void* data)
+{
+  OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
+  PRINT(3)( "Quitting Orxonox %p\n", exec);
+  if(exec->shouldsave())
+    exec->writeToFile(Window::mainWindow);
+  gtk_main_quit();
+}
+#else /* HAVE_GTK2 */
+/**
+   \brief Starts ORXONOX.(not really implemented yet, but the function is there.\n
+   \param widget the widget that executed the start command
+   \param data additional data
+*/
+int OrxonoxGuiExec::startOrxonox(void* widget, void* data)
+{
+  OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
+  PRINT(3)("Starting Orxonox\n");
+  if(exec->shouldsave())
+    exec->writeToFile(Window::mainWindow);
+  system("cd ..;./orxonox"); //!< \todo fix this. should execute orxonox for real(coded not over the shell)
+}
+/**
+   \brief Quits ORXONOX.
+   \param widget the widget that executed the Quit command
+   \param data additional data
+
+   This is a Signal and can be executed through Widget::signal_connect
+*/
+int OrxonoxGuiExec::quitOrxonox(void* widget, void* data)
+{
+  OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
+  PRINT(3)("Quiting Orxonox");
+  if(exec->shouldsave())
+    exec->writeToFile(Window::mainWindow);
+}
+
 #endif /* HAVE_GTK2 */
Index: orxonox/trunk/src/gui/orxonox_gui_exec.h
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_exec.h	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_exec.h	(revision 3423)
@@ -24,22 +24,44 @@
   char* configFile;            //!< The name of the .orxonox.conf(ig)-file.
   FILE* CONFIG_FILE;           //!< Filehandler for reading and writing.
+  
+  //! A struct that holds informations about variables.
+  struct VarInfo
+  {
+    char* variableName;        //!< The Name of this variable;
+    char* variableValue;       //!< The Value this variable gets.
+  };
 
  public:
-  OrxonoxGuiExec (Window* orxonoxGUI);
-  ~OrxonoxGuiExec ();
+  OrxonoxGuiExec(void);
+  ~OrxonoxGuiExec(void);
   
-  Widget* getWidget ();
+  Widget* getWidget(void);
   
-  void setFilename (char* filename);
-  int shouldsave ();
-  void writeToFile (Widget* widget);
-  void writeFileText (Widget* widget, int depth);
-  void readFromFile (Widget* widget);
-  void readFileText (Widget* widget, char* variableName, char* variableValue, int depth);
+  void setFilename(char* filename);
+  char* getConfigFile(void);
+  int shouldsave(void);
+  void writeToFile(Widget* widget);
+  void writeFileText(Widget* widget, int depth);
+  void readFromFile(Widget* widget);
+  static void readFileText(Widget* widget, void* varInfo);
   Widget* locateGroup(Widget* widget, char* groupName, int depth);
 
+#ifdef HAVE_GTK2
+  static int startOrxonox(GtkWidget *widget, void* data);
+  static int quitOrxonox(GtkWidget *widget, void* data);
+#else /* HAVE_GTK2 */
+  static int startOrxonox(void* widget, void* data);
+  static int quitOrxonox(void* widget, void* data);
+#endif /* HAVE_GTK2 */
 };
-#ifdef HAVE_GTK2
-  gint startOrxonox (GtkWidget *widget, Widget* data);
-#endif /* HAVE_GTK2 */
+
+
+struct HashTable
+{
+  char* name;
+  char* value;
+  HashTable* next;
+};
+
+
 #endif /* _ORXONOX_GUI_EXEC_H */
Index: orxonox/trunk/src/gui/orxonox_gui_flags.cc
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_flags.cc	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_flags.cc	(revision 3423)
@@ -28,20 +28,25 @@
 /**
    \brief Creates the Flags-Frame
-   \param widget The Widget from which the data will be parsed
 */
-OrxonoxGuiFlags::OrxonoxGuiFlags (Widget* widget)
+OrxonoxGuiFlags::OrxonoxGuiFlags(void)
 {
-  flagText = (char*) malloc (1024);
+  this->flagsFrame = new Frame("Orxonox-Startup-Flags:");
+  this->flagsBox = new Box('v');
 
-  flagsFrame = new Frame ("Orxonox-Startup-Flags:");
-  flagsBox = new Box ('v');
+  this->flagsLabel = new Label();
+  this->flagsLabel->setSize(260,60);
+  this->flagsBox->fill(flagsLabel);
+  this->shortFlags = new CheckButton("shortFlags");
+  this->flagsBox->fill(shortFlags);
 
-  flagsLabel = new Label ();
-  flagsLabel->setSize (260,60);
-  flagsBox->fill (flagsLabel);
-  shortFlags = new CheckButton ("shortFlags");
-  flagsBox->fill (shortFlags);
+  this->flagsFrame->fill(flagsBox);
+}
 
-  flagsFrame->fill (flagsBox);
+/**
+   \brief Destructs the Flags-stuff
+*/
+OrxonoxGuiFlags::~OrxonoxGuiFlags(void)
+{
+  // nothing to do here
 }
 
@@ -50,7 +55,7 @@
    \returns Frame that holds the Flagtext.
 */
-Widget* OrxonoxGuiFlags::getWidget ()
+Widget* OrxonoxGuiFlags::getWidget(void)
 {
-  return flagsFrame;
+  return this->flagsFrame;
 }
 
@@ -59,10 +64,14 @@
    \param widget the Widget from which on to scan for deeper Options and their settings.
 */
-void OrxonoxGuiFlags::setTextFromFlags (Widget* widget)
+void OrxonoxGuiFlags::setTextFromFlags(Widget* widget)
 {
-  sprintf (flagText, "");
-  strcat (flagText, "orxonox");
-  FlagsText (widget);
-  flagsLabel->setText (flagText);
+  FlagInfo flagInfo;
+  flagInfo.shortFlags = this->shortFlags;
+  flagInfo.flagsLabel = this->flagsLabel;
+
+  this->flagsLabel->ereaseText();
+  this->flagsLabel->appendText("orxonox");
+  widget->walkThrough(OrxonoxGuiFlags::flagsText, &flagInfo, 0);
+  //  flagsLabel->setTitle(flagText);
 }
 
@@ -70,36 +79,28 @@
     \brief this actually sets the flagtext, and appends it to flagText
     \param widget like OrxonoxGuiFlags::setTextFromFlags(widget)
+    \param flagInfo Information aboout the Flag that should be updated.
 */
-void OrxonoxGuiFlags::FlagsText(Widget* widget)
+void OrxonoxGuiFlags::flagsText(Widget* widget, void* flagInfo)
 {
-  if (widget->isOption >= 1)
-    if  (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->defaultValue && (static_cast<Option*>(widget)->flagName || static_cast<Option*>(widget)->flagNameShort ))
+  FlagInfo* info =(FlagInfo*)flagInfo;
+  if(widget->isOption >= 1)
+    if (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->defaultValue )
       {
-	if (shortFlags->isActive())
+	if(info->shortFlags->isActive() && static_cast<Option*>(widget)->flagNameShort)
 	  {
-	    strcat (flagText, " -");
-	    strcat (flagText, static_cast<Option*>(widget)->flagNameShort);
+	    info->flagsLabel->appendText(" -");
+	    info->flagsLabel->appendText(static_cast<Option*>(widget)->flagNameShort);
 	  }
-	else
+	else if(!info->shortFlags->isActive() && static_cast<Option*>(widget)->flagName)
 	  {
-	    strcat (flagText, " --");
-	    strcat (flagText, static_cast<Option*>(widget)->flagName);
+	    info->flagsLabel->appendText(" --");
+	    info->flagsLabel->appendText(static_cast<Option*>(widget)->flagName);
 	  }
-	if (static_cast<Option*>(widget)->isOption == 2)
+
+	if(static_cast<Option*>(widget)->isOption == 2)
 	  {
-	    sprintf (flagText, "%s=%i", flagText, static_cast<Option*>(widget)->value);
+	    info->flagsLabel->appendText("=");
+	    info->flagsLabel->appendInt(static_cast<Option*>(widget)->value);
 	  }
       }
-  switch (widget->isOption)
-    {
-    case -1:
-      FlagsText (static_cast<Container*>(widget)->down);
-      break;
-    case -2:
-      FlagsText (static_cast<Box*>(widget)->down);
-      break;
-    } 
-  
-  if (widget->next != NULL)
-    FlagsText (widget->next);
 }
Index: orxonox/trunk/src/gui/orxonox_gui_flags.h
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_flags.h	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_flags.h	(revision 3423)
@@ -17,14 +17,18 @@
   CheckButton* shortFlags;    //!< CheckButton to change the display of short and long flags \todo show long if long not availible...
   Label* flagsLabel;          //!< The Label of the Flags
-  char* flagText;             //!< The Text of the Label. \todo Delete when Object is destroyed.
 
  public:
-  OrxonoxGuiFlags (Widget* widget);
-  ~OrxonoxGuiFlags ();
+  OrxonoxGuiFlags(void);
+  ~OrxonoxGuiFlags(void);
 
-  void setTextFromFlags (Widget* widget);
-  void OrxonoxGuiFlags::FlagsText(Widget* widget);
+  void setTextFromFlags(Widget* widget);
+  static void flagsText(Widget* widget, void* flagInfo);
   
-  Widget* getWidget ();
+  struct FlagInfo
+  {
+    CheckButton* shortFlags;
+    Label* flagsLabel;
+  };
+  Widget* getWidget(void);
 };
 #endif /* _ORXONOX_GUI_FLAGS_H */
Index: orxonox/trunk/src/gui/orxonox_gui_gtk.cc
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_gtk.cc	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_gtk.cc	(revision 3423)
@@ -34,10 +34,7 @@
 // temporarily.
 #include "orxonox_gui_flags.h"
-#include "orxonox_gui_exec.h"
 extern Window* orxonoxGUI;
 extern OrxonoxGuiFlags* flags;
-extern OrxonoxGuiExec* exec;
-
-#ifdef HAVE_GTK2
+
 /**
    \brief Initializes the Guis GTK-stuff.
@@ -45,18 +42,93 @@
    \param argv The Argument strings.
 */
-bool initGTK(int argc, char *argv[])
-{
-  gtk_init (&argc, &argv);
+bool initGUI(int argc, char *argv[])
+{
+#ifdef HAVE_GTK2
+#ifdef HAVE_GTHREAD
+  PRINTF(3)("Initializing the ThreadSystem of the GUI\n");
+  g_thread_init(NULL);
+  gdk_threads_init();
+#endif /* HAVE_GTHREAD */
+  gtk_init(&argc, &argv);
   gtk_rc_parse( "rc" );
-}
-
-/**
-   \brief enters the GTK-main-loop
-*/
-bool mainloopGTK(void)
-{
+#endif /* HAVE_GTK2 */
+}
+
+
+/**
+   \brief enters the GUI's main-loop
+*/
+bool mainloopGUI(void)
+{
+#ifdef HAVE_GTK2
+  gdk_threads_enter();
   gtk_main();
-}
-#endif /* HAVE_GTK2 */
+  gdk_threads_leave();
+  delete Window::mainWindow;
+#else /* HAVE_GTK2 */
+  char boolAns = 'y';
+  char ans[10]; 
+  while(true)
+    {
+      PRINT(0)(" Listing all the Orxonox Options: \n");
+      PRINT(0)("  #############################\n");
+      Window::mainWindow->walkThrough(Widget::listOptionsAndGroups, 1);
+      
+      PRINT(0)("\nDo you want change any of the above values now? [Yn] ");
+      cin >>boolAns ;
+      if (boolAns =='n' || boolAns=='N')
+	break;
+      
+      PRINT(0)("\n Listing all groups\n");
+      PRINT(0)("  #################\n");
+      int groupCount = 0;
+      Window::mainWindow->walkThrough(Widget::listGroups, &groupCount, 1);
+      
+      PRINT(0)("\nIn which Group? [1-%d] ", groupCount);
+      Packer* group;
+      while(true)
+	{
+	  cin >> ans;
+	  int ansIp = atoi(ans);
+	  if (ansIp <= groupCount)
+	    {
+	      group = static_cast<Packer*>(Window::mainWindow->findGroupByNumber(&ansIp, 1));
+	      break;
+	    }
+	  else
+	    PRINT(0)("\nChoose a smaler Number please: [1-%d] ", groupCount);
+	}
+      PRINT(0)("\n\nGroup: [%s]\n\n", group->groupName);
+      int optionCount = 0;
+      group->walkThrough(Widget::listOptions, &optionCount, 0);
+      PRINT(0)("\nWhich Option? [1-%d] ", optionCount);
+      Option* option;
+      while(true)
+	{
+	  cin >> ans;
+	  int ansIp = atoi(ans);
+	  if (ansIp <= groupCount)
+	    {
+	      option = static_cast<Option*>(group->findOptionByNumber(&ansIp, 0));
+	      break;
+	    }
+	  else
+	    PRINT(0)("\nChoose a smaler Number please: [1-%d] ", optionCount);
+	}
+      PRINT(0)("\n\n:: %s ::\n", option->title);
+      option->changeOption();
+      
+      // here follows the rest.... this will be nasty.
+      //! \todo move this into the gui-gtk-file
+      //! \todo finish it.
+    }
+#endif /* HAVE_GTK2 */
+  
+}
+
+
+//////////////////////////////
+/// DEFINING WIDGET-CLASES ///
+//////////////////////////////
 
 /* WIDGET */
@@ -66,19 +138,7 @@
    This is still pretty crappy.
 */
-Widget::~Widget()
-{
-  //  cout << "hiding: " <<this->label <<"\n";
-  this->hide();
-  //  cout << "check if Packer: "<<this->label <<"\n";
-  if (this->isOption < 0)
-    {
-      //  cout << "get Down "<<this->label <<"\n";
-      static_cast<Packer*>(this)->down->~Widget();
-    }
-  //  cout << "next != NULL?: " <<this->label <<"\n";
-  if (this->next != NULL)
-    this->next->~Widget();
-  cout << "delete Widget: " <<this->label <<"\n";
-  //  delete widget;
+Widget::~Widget(void)
+{
+  this->destroy();
 }
 
@@ -87,18 +147,42 @@
    Initializes the next Pointer and the other Widget-specific Defaults.
 */
-void Widget::init()
+void Widget::init(void)
 {
   next = NULL;
-  label = NULL;
+  this->title = NULL;
   return;
 }
 
 /**
+   \brief Destroys a Widget 
+*/
+void Widget::destroy(void)
+{
+  if (this->title)
+    {
+      delete []this->title;
+    }
+  
+  PRINTF(4)("deleting the Widget part.\n");
+
+  PRINTF(4)("deleting recursively\n");
+
+  // deleting next item if existent
+  if (this->next)
+    delete this->next;
+  this->next = NULL;
+
+  //!  \todo not hiding widget, deleting.
+  //  this->hide();
+  //  delete this->widget;
+}
+
+/**
    \brief makes the widget visible.
 */
-void Widget::show()
-{
-#ifdef HAVE_GTK2
-  gtk_widget_show (this->widget);
+void Widget::show(void)
+{
+#ifdef HAVE_GTK2
+  gtk_widget_show(this->widget);
 #endif /* HAVE_GTK2 */
 }
@@ -107,8 +191,8 @@
    \brief hides the widget.
 */
-void Widget::hide()
-{
-#ifdef HAVE_GTK2
-  gtk_widget_hide (this->widget);
+void Widget::hide(void)
+{
+#ifdef HAVE_GTK2
+  gtk_widget_hide(this->widget);
 #endif /* HAVE_GTK2 */
 }
@@ -122,88 +206,295 @@
 {
 #ifdef HAVE_GTK2
-  gtk_widget_set_usize (this->widget, width, height);
-#endif /* HAVE_GTK2 */
-}
-
-#ifdef HAVE_GTK2
-/** 
-    \brief Connect any signal to any given Sub-widget
-*/
-gulong Widget::connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *))
-{
-  return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL);
-}
-
-/**
-   \brief Connect a signal with additionally passing the whole Object
-*/
-gulong Widget::connectSignal (char* event, gint (*signal)( GtkWidget*, Widget *))
-{
-  return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), this);
-}
-
-/**
-   \brief Connect a signal with additionally passing a whole external Object
-*/
-gulong Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *))
-{
-  return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
-}
-
-/**
-   \brief Connect a signal with additionally passing a whole external Object
-*/
-gulong Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *))
-{
-  return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
-}
-
-void Widget::disconnectSignal (gulong signalID)
-{
-  g_signal_handler_disconnect (G_OBJECT (this->widget), signalID);
-}
-#endif /* HAVE_GTK2 */
+  gtk_widget_set_usize(this->widget, width, height);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief searches through widgets for a Name.
+*/
+Widget* Widget::findWidgetByName(char* name, unsigned int depth)
+{
+
+  if (this->title && !strcmp(this->title, name))
+    return this;
+
+  if (this->isOption < 0 && static_cast<Packer*>(this)->down)
+    {
+      Widget* tmp = static_cast<Packer*>(this)->down->findWidgetByName(name, depth+1);
+      if (tmp)
+	return tmp;
+    }
+  
+  if (depth>0 && this->next)
+    return this->next->findWidgetByName(name, depth);
+
+  return NULL;
+}
 
 /**
    \brief Moves through all the Widgets downwards from this and executes the function on them.
-   \param Function must be of type void and takes a Widget* as an Input. 
-*/
-void Widget::walkThrough (void (*function)(Widget*))
+   \param function must be of type void and takes a Widget* as an Input. 
+   \param depth the current depth. if > 0 then the next Widget will also be walked through.
+*/
+void Widget::walkThrough(void(*function)(Widget*), unsigned int depth)
 {
   function(this);
   if (this->isOption < 0)
     {
-      static_cast<Packer*>(this)->down->walkThrough (function);
+      static_cast<Packer*>(this)->down->walkThrough(function, depth+1);
     } 
 
-  if (this->next != NULL)
-    this->next->walkThrough(function);
+  if (this->next && depth != 0)
+    this->next->walkThrough(function, depth);
+}
+
+/**
+   \brief Moves through all the Widgets downwards from this and executes the function on them.
+   \param function must be of type void and takes a Widget* as an Input.
+   \param data Additional Data you want to pass to the function.
+   \param depth the current depth. if > 0 then the next Widget will also be walked through.
+*/
+void Widget::walkThrough(void(*function)(Widget*, void*), void* data, unsigned int depth)
+{
+  function(this, data);
+  if (this->isOption < 0)
+    {
+      static_cast<Packer*>(this)->down->walkThrough(function, data, depth+1);
+    }
+  if (this->next && depth != 0)
+    this->next->walkThrough(function, data, depth);
 }
 
 /** 
-    \brief This is for listing the option of "widget"
+    \brief This is for listing the options of "widget"
     \param widget specifies the widget that should be listed
 */
-void Widget::listOptions (Widget* widget)
+void Widget::listOptionsAndGroups(Widget* widget)
 {
   if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
     cout << "[" << static_cast<Packer*>(widget)->groupName << "]\n";
   if (widget->isOption >= 1 && widget->isOption <= 3)
-    cout << "  " << static_cast<Option*>(widget)->label <<" is : " << static_cast<Option*>(widget)->value <<endl;
+    cout << "  " << static_cast<Option*>(widget)->title <<" is : " << static_cast<Option*>(widget)->value <<endl;
   else if (widget->isOption == 5)
-    cout << "  " << static_cast<Option*>(widget)->label <<" is : " << static_cast<OptionLabel*>(widget)->cValue <<endl;
-}
-
+    cout << "  " << static_cast<Option*>(widget)->title <<" is : " << static_cast<OptionLabel*>(widget)->cValue <<endl;
+}
+
+/** 
+    \brief This is for listing the options of "widget"
+    \param widget specifies the widget that should be listed
+*/
+void Widget::listOptions(Widget* widget)
+{
+  if (widget->isOption >= 1 && widget->isOption <= 3)
+    cout << "  " << static_cast<Option*>(widget)->title <<" is : " << static_cast<Option*>(widget)->value <<endl;
+  else if (widget->isOption == 5)
+    cout << "  " << static_cast<Option*>(widget)->title <<" is : " << static_cast<OptionLabel*>(widget)->cValue <<endl;
+}
+
+/** 
+    \brief This is for listing the options of "widget"
+    \param widget specifies the widget that should be listed
+    \param data A Counter, that always knows how many Options have been found yet.
+*/
+void Widget::listOptions(Widget* widget, void* data)
+{
+  
+  if (widget->isOption >= 1 && widget->isOption <= 3)
+    {
+      int* count =(int*)data;
+      *count = *count +1;
+      cout << *count << ": " << static_cast<Option*>(widget)->title <<" is : " << static_cast<Option*>(widget)->value <<endl;
+    }
+  else if (widget->isOption == 5)
+    {
+      int* count =(int*)data;
+      *count = *count +1;
+      cout << *count << ": " << static_cast<Option*>(widget)->title <<" is : " << static_cast<OptionLabel*>(widget)->cValue <<endl;
+    }
+}
+
+/** 
+    \brief Finds an Option by a given number(the n'th option found away from this Widget)
+    \param number The Count of options to wait(by reference)
+    \param depth The depth of the sarch. if 0 it will not search next pointer
+    
+    \todo should return Option* would be much sexier.
+*/
+Widget* Widget::findOptionByNumber(int* number, unsigned int depth)
+{
+  if (isOption > 0)
+    {
+      --*number;
+      if (*number <= 0)
+	{
+	  return this;
+	}
+    }
+  if (this->isOption < 0 && static_cast<Packer*>(this)->down)
+    {
+      Widget* tmp = static_cast<Packer*>(this)->down->findOptionByNumber(number, depth+1);
+      if (tmp)
+	return tmp;
+    }
+  if (depth>0 && this->next)
+    return this->next->findOptionByNumber(number, depth);
+
+  return NULL;
+}
+
+/** 
+    \brief This is for listing the groups of "widget"
+    \param widget specifies the widget that should be listed
+*/
+void Widget::listGroups(Widget* widget)
+{
+  if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
+    cout << "[" << static_cast<Packer*>(widget)->groupName << "]\n";
+}
+
+/** 
+    \brief This is for listing the Groups of "widget". It also displays the n'th number found.
+    \param widget specifies the widget that should be listed
+    \param data the Counter, that will show the number(this function will raise it by one if a Group is fount.
+*/
+void Widget::listGroups(Widget* widget, void* data)
+{
+  if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
+    {
+      int* count =(int*)data;
+      *count = *count +1;
+      cout << *count <<": [" << static_cast<Packer*>(widget)->groupName << "]\n";
+    }
+}
+
+/** 
+    \brief Finds a Group by a given number(the n'th Group found away from this Widget)
+    \param number The Count of options to wait(by reference)
+    \param depth The depth of the sarch. if 0 it will not search next pointer
+*/
+Widget* Widget::findGroupByNumber(int* number, unsigned int depth)
+{
+  if (isOption < 0 && static_cast<Packer*>(this)->groupName)
+    {
+      --*number;
+      if (*number <= 0)
+	{
+	  return this;
+	}
+    }
+  if (this->isOption < 0 && static_cast<Packer*>(this)->down)
+    {
+      Widget* tmp = static_cast<Packer*>(this)->down->findGroupByNumber(number, depth+1);
+      if (tmp)
+	return tmp;
+    }
+  if (depth>0 && this->next)
+    return this->next->findGroupByNumber(number, depth);
+
+  return NULL;
+}
+ 
 /** 
     \brief This is for setting the option of "widget"
     \param widget specifies the widget that should be set.
 */
-void Widget::setOptions (Widget* widget)
+void Widget::setOptions(Widget* widget)
 {
   if (widget->isOption >= 1)
-    static_cast<Option*>(widget)->redraw();// <<" is : " << static_cast<Option*>(this)->value <<endl;
-}
-
-#ifdef HAVE_GTK2
+    static_cast<Option*>(widget)->redraw();
+}
+
+/**
+   \brief Walks through all the Flags given at startuptime.
+*/
+void Widget::flagCheck(Widget* widget, void* flagName)
+{
+  if (widget->isOption>=1)
+    {      
+      Option* option =(Option*)widget;
+      char* name =(char*)flagName;
+      char* value = NULL;
+      bool found = false;
+      // check if long flag matches
+      if ((option->flagName && strlen(name)>2 && !strncmp(name+2, option->flagName, strlen(option->flagName)) &&(name[strlen(option->flagName)+2] == '\0' || name[strlen(option->flagName)+2] == '=') ))
+	{
+	  found = true;
+	  if (name[strlen(option->flagName)+2] == '=')
+	    {
+	      value = name+strlen(option->flagName)+3;
+	    }
+	}
+      else if (option->flagNameShort && strlen(name)>1 && !strncmp(name+1, option->flagNameShort, strlen(option->flagNameShort))&&(name[strlen(option->flagNameShort)+1] == '\0' || name[strlen(option->flagNameShort)+1] == '=')) // check if short flag matches
+	{
+	  found = true;
+	  if (name[strlen(option->flagNameShort)+1] == '=')
+	    {
+	      value = name+strlen(option->flagNameShort)+2;
+	    }	  
+	}
+
+      if (found)
+	{
+	  PRINT(3)("found matching Flag %s\n", name);
+	  if (value)
+	    {
+	      PRINT(3)("with Value %s\n", value);
+	      option->value = atoi(value);
+	    }
+	  else
+	    {
+	      option->value = !option->defaultValue;
+	    }
+	  option->redraw();
+	}
+
+    }
+}
+
+#ifdef HAVE_GTK2
+/** 
+    \brief Connect any signal to any given Sub-widget
+*/
+gulong Widget::connectSignal(char* event, gint(*signal)(GtkWidget*, GdkEvent*, void *))
+{
+  return g_signal_connect(G_OBJECT(this->widget), event, G_CALLBACK(signal), NULL);
+}
+
+/**
+   \brief Connect a signal with additionally passing the whole Object
+*/
+gulong Widget::connectSignal(char* event, gint(*signal)( GtkWidget*, Widget *))
+{
+  return g_signal_connect(G_OBJECT(this->widget), event, G_CALLBACK(signal), this);
+}
+
+/**
+   \brief Connect a signal with additionally passing a whole external Object
+*/
+gulong Widget::connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, GdkEvent*, void *))
+{
+  return g_signal_connect(G_OBJECT(this->widget), event, G_CALLBACK(signal), extObj);
+}
+
+/**
+   \brief Connect a signal with additionally passing a whole external Object
+*/
+gulong Widget::connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, void *))
+{
+  return g_signal_connect(G_OBJECT(this->widget), event, G_CALLBACK(signal), extObj);
+}
+
+/**
+   \brief Connect a signal with additionally passing a whole external Object
+*/
+gulong Widget::connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, GdkEventKey*, void *))
+{
+  return g_signal_connect(G_OBJECT(this->widget), event, G_CALLBACK(signal), extObj);
+}
+
+void Widget::disconnectSignal(gulong signalID)
+{
+  g_signal_handler_disconnect(G_OBJECT(this->widget), signalID);
+}
 
 /**
@@ -213,5 +504,5 @@
    \param nothing nothin.
 */
-gint Widget::doNothingSignal (GtkWidget *widget, GdkEvent* event, void* nothing)
+gint Widget::doNothingSignal(GtkWidget *widget, GdkEvent* event, void* nothing)
 {
 }
@@ -228,8 +519,8 @@
    Sets the down-pinter to NULL and other PackerSpecific-values to their defaults.
 */
-void Packer::init (void)
-{
-  down = NULL;
-  groupName = NULL;
+void Packer::init(void)
+{
+  this->down = NULL;
+  this->groupName = NULL;
 
 
@@ -239,13 +530,31 @@
 
 /**
+   \brief Destroys a Packer.
+*/
+void Packer::destroy(void)
+{ 
+  PRINTF(4)("deleting the Packer part.\n");
+  
+  if (this->groupName)
+    delete []this->groupName;
+
+  //deleting recursively.
+  if (this->down)
+    delete this->down;
+  this->down = NULL;
+
+  static_cast<Widget*>(this)->destroy();
+}
+
+/**
    \brief Sets the group name under which all the lower widgets of this will be saved.
    \param name The name of the group.
 */
-void Packer::setGroupName (char* name)
-{
-  if (groupName)
-    delete groupName;
-  groupName = new char [strlen(name)+1];
-  strcpy(groupName, name);
+void Packer::setGroupName(char* name)
+{
+  if (this->groupName)
+    delete []this->groupName;
+  this->groupName = new char[strlen(name)+1];
+  strcpy(this->groupName, name);
 }
 
@@ -254,7 +563,7 @@
    \returns name The name of the group.
 */
-char* Packer::getGroupName (void)
-{
-  return groupName;
+char* Packer::getGroupName(void)
+{
+  return this->groupName;
 }
 
@@ -266,11 +575,21 @@
    sets the Container-Specific defaults.
 */
-void Container::init (void)
-{
-  isOption = -1;
+void Container::init(void)
+{
+  this->isOption = -1;
 
   static_cast<Packer*>(this)->init();
 
   return;
+}
+
+/**
+   \brief Destroys a Container.
+*/
+void Container::destroy(void)
+{ 
+  PRINTF(4)("deleting the Container part.\n");
+
+  static_cast<Packer*>(this)->destroy();
 }
 
@@ -281,18 +600,18 @@
    It does this by filling up the down pointer only if down points to NULL.
 */
-void Container::fill (Widget *lowerWidget)
+void Container::fill(Widget *lowerWidget)
 {
   if (this->down == NULL)
     {
 #ifdef HAVE_GTK2
-      gtk_container_add (GTK_CONTAINER (this->widget), lowerWidget->widget);
+      gtk_container_add(GTK_CONTAINER(this->widget), lowerWidget->widget);
 #endif /* HAVE_GTK2 */
       this->down = lowerWidget;
     }
   else
-    cout << "!!error!! You try to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n"<<endl;
-}
-
-// gtk_container_set_border_width (GTK_CONTAINER (widget), 5);
+    PRINTF(1)("!!error!! You try to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n");
+}
+
+// gtk_container_set_border_width(GTK_CONTAINER(widget), 5);
 
 /* WINDOW */
@@ -303,5 +622,5 @@
    \brief Adds a new Window Windows to the List of Windows.
    \param windowToAdd The Windows that should be added to the List
-   \todo this instead of windowToAdd (possibly)
+   \todo this instead of windowToAdd(possibly)
 */
 void Window::addWindow(Window* windowToAdd)
@@ -314,5 +633,5 @@
 
   Widget* tmpWindow = mainWindow;
-  while (tmpWindow->next)
+  while(tmpWindow->next)
     tmpWindow = tmpWindow->next;
   tmpWindow->next = windowToAdd;
@@ -322,9 +641,8 @@
       
 
-
 /**
    \brief Creating a new Window without a Name
 */
-Window::Window (void)
+Window::Window(void)
 {
   this->init();
@@ -335,8 +653,17 @@
    \param windowName the name the window should get.
 */
-Window::Window (char* windowName)
+
+Window::Window(char* windowName)
 {
   this->init();
-  this->setTitle (windowName);
+  this->setTitle(windowName);
+}
+
+/**
+   \brief Destructs a Window.
+*/
+Window::~Window(void)
+{
+  this->destroy();
 }
 
@@ -344,5 +671,5 @@
    \brief initializes a new Window
 */
-void Window::init()
+void Window::init(void)
 {
   if (!mainWindow)
@@ -354,11 +681,25 @@
 
 #ifdef HAVE_GTK2
-  widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  gtk_window_set_policy (GTK_WINDOW(widget), TRUE, TRUE, TRUE);
+  widget = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+  gtk_window_set_policy(GTK_WINDOW(widget), TRUE, TRUE, TRUE);
 #if !defined(__WIN32__)
-  //  gtk_window_set_decorated (GTK_WINDOW (widget), FALSE);
+  //  gtk_window_set_decorated(GTK_WINDOW(widget), FALSE);
 #endif 
-  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
-#endif /* HAVE_GTK2 */
+  gtk_container_set_border_width(GTK_CONTAINER(widget), 3);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Destroys a Window.
+*/
+void Window::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the Window: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the Window.\n");
+  //  this->hide();
+  static_cast<Container*>(this)->destroy();
+  
 }
 
@@ -366,19 +707,19 @@
    \brief Shows all Widgets that are included within this->widget.
 */
-void Window::showall ()
-{
-  if (!isOpen)
-    {
-      //      printf ("showall\n");
-#ifdef HAVE_GTK2
-      gtk_widget_show_all  (widget);
+void Window::showall(void)
+{
+  if (!this->isOpen)
+    {
+      //      printf("showall\n");
+#ifdef HAVE_GTK2
+      gtk_widget_show_all(this->widget);
 #endif /* HAVE_GTK2 */ 
-     isOpen = true;
+     this->isOpen = true;
     }
   else
     {
-      //      printf ("showone\n");
-#ifdef HAVE_GTK2
-      gtk_widget_show (widget);
+      //      printf("showone\n");
+#ifdef HAVE_GTK2
+      gtk_widget_show(this->widget);
 #endif /* HAVE_GTK2 */
     }
@@ -389,12 +730,12 @@
    \param title title the Window should get.
 */
-void Window::setTitle (char* title)
-{
-  if (label)
-    delete []label;
-  label = new char[strlen(title)+1];
-  strcpy(label, title);
-#ifdef HAVE_GTK2
-  gtk_window_set_title (GTK_WINDOW (widget), title);
+void Window::setTitle(char* title)
+{
+  if (this->title)
+    delete []this->title;
+  this->title = new char[strlen(title)+1];
+  strcpy(this->title, title);
+#ifdef HAVE_GTK2
+  gtk_window_set_title(GTK_WINDOW(widget), title);
 #endif /* HAVE_GTK2 */
 }
@@ -403,5 +744,5 @@
    \brief opens up a Window and fixes the Focus to it
 */
-void Window::open()
+void Window::open(void)
 {
   if (this != mainWindow)
@@ -409,6 +750,6 @@
       isOpen = true;
 #ifdef HAVE_GTK2
-      gtk_widget_show_all(widget);
-      gtk_grab_add(widget);
+      gtk_widget_show_all(this->widget);
+      gtk_grab_add(this->widget);
 #endif /* HAVE_GTK2 */
     }
@@ -418,19 +759,19 @@
    \brief closes up a Window and removes the Focus from it
 */
-void Window::close()
+void Window::close(void)
 {
   if (this != mainWindow)
     {
-      isOpen = false;
-#ifdef HAVE_GTK2
-      gtk_grab_remove(widget);
-      gtk_widget_hide (widget);
-#endif /* HAVE_GTK2 */
-    }
-}
-
-#ifdef HAVE_GTK2
-/**
-   \brief opens up a window (not topmost Window).
+      this->isOpen = false;
+#ifdef HAVE_GTK2
+      gtk_grab_remove(this->widget);
+      gtk_widget_hide(this->widget);
+#endif /* HAVE_GTK2 */
+    }
+}
+
+#ifdef HAVE_GTK2
+/**
+   \brief opens up a window(not topmost Window).
    this is the Signal that does it. !!SIGNALS ARE STATIC!!
    \param widget the widget that did it.
@@ -438,5 +779,5 @@
    \param window the Window that should be opened
 */
-gint Window::windowOpen (GtkWidget *widget, GdkEvent* event, void* window)
+gint Window::windowOpen(GtkWidget *widget, GdkEvent* event, void* window)
 {
   static_cast<Window*>(window)->open();
@@ -444,5 +785,5 @@
 
 /**
-   \brief closes a window (not topmost Window).
+   \brief closes a window(not topmost Window).
    this is the Signal that does it. !!SIGNALS ARE STATIC!!
    \param widget the widget that did it!
@@ -450,24 +791,9 @@
    \param window the Window that should be closed
 */
-gint Window::windowClose (GtkWidget *widget, GdkEvent* event, void* window)
+gint Window::windowClose(GtkWidget *widget, GdkEvent* event, void* window)
 {
   static_cast<Window*>(window)->close();
 }
 
-/**
- * Quits the orxonox_GUI.
- * This can be called as a Signal and is therefor static
- \param widget The widget that called this function
- \param event the event that happened to execute this function
- \param data some data passed with the Signal
- */
-gint Window::orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data)
-{
-  if (exec->shouldsave())
-    exec->writeToFile (Window::mainWindow);
-
-  gtk_main_quit();
-  return FALSE;
-}
 #endif /* HAVE_GTK2 */
 
@@ -478,5 +804,5 @@
     \brief Creates a new Frame without a name
 */
-Frame::Frame (void)
+Frame::Frame(void)
 {
   this->init();
@@ -486,5 +812,5 @@
    \brief Creates a new Frame with name title
 */
-Frame::Frame (char* title)
+Frame::Frame(char* title)
 {
   this->init();
@@ -492,15 +818,36 @@
 }
 
+/**
+   \brief destrcucts a Frame
+*/
+Frame::~Frame(void)
+{
+  this->destroy();
+}
+
 /** 
     \brief Initializes a new Frame with default settings
 */
-void Frame::init()
+void Frame::init(void)
 {
   static_cast<Container*>(this)->init();
 
 #ifdef HAVE_GTK2
-  widget = gtk_frame_new ("");
-  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
-#endif /* HAVE_GTK2 */
+  this->widget = gtk_frame_new("");
+  gtk_container_set_border_width(GTK_CONTAINER(this->widget), 3);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Destroys a Frame.
+*/
+void Frame::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the Frame: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the Frame.\n");
+
+   static_cast<Container*>(this)->destroy();
 }
 
@@ -509,12 +856,12 @@
    \param title The title the Frame should get.
 */
-void Frame::setTitle (char* title)
-{
-  if (label)
-    delete []label;
-  label = new char[strlen(title)+1];
-  strcpy(label, title);
-#ifdef HAVE_GTK2
-  gtk_frame_set_label (GTK_FRAME (widget), title);
+void Frame::setTitle(char* title)
+{
+  if (this->title)
+    delete []this->title;
+  this->title = new char[strlen(title)+1];
+  strcpy(this->title, title);
+#ifdef HAVE_GTK2
+  gtk_frame_set_label(GTK_FRAME(widget), title);
 #endif /* HAVE_GTK2 */
 }
@@ -525,13 +872,14 @@
    \brief Creates a new EventBox with default settings.
 */
-EventBox::EventBox ()
+EventBox::EventBox(void)
 {
   this->init();
 }
+
 /**
    \brief Creates a new EventBox with name title
-   \param title title the Eventbox should get (only data-structure-internal)
-*/
-EventBox::EventBox (char* title)
+   \param title title the Eventbox should get(only data-structure-internal)
+*/
+EventBox::EventBox(char* title)
 {
   this->init();
@@ -540,28 +888,50 @@
 
 /**
+   \brief destructs an EventBox.
+*/
+EventBox::~EventBox(void)
+{
+  this->destroy();
+
+}
+
+/**
    \brief Initializes a new EventBox
 */
 void EventBox::init(void)
 {
-  isOption = -1;
+  this->isOption = -1;
 
   static_cast<Container*>(this)->init();
 
 #ifdef HAVE_GTK2
-  widget = gtk_event_box_new ();
-  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
-#endif /* HAVE_GTK2 */
-}
-
-/**
-   \brief Sets the Title of the EventBox (not implemented)
-   \param title Name the EventBox should get (only datastructure-internal).
-*/
-void EventBox::setTitle (char* title)
-{
-  if (label)
-    delete []label;
-  label = new char[strlen(title)+1];
-  strcpy(label, title);
+  this->widget = gtk_event_box_new();
+  gtk_container_set_border_width(GTK_CONTAINER(this->widget), 3);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Destroys an EventBox.
+*/
+void EventBox::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the EventBox: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the EventBox.\n");
+
+  static_cast<Container*>(this)->destroy();
+}
+
+/**
+   \brief Sets the Title of the EventBox(not implemented)
+   \param title Name the EventBox should get(only datastructure-internal).
+*/
+void EventBox::setTitle(char* title)
+{
+  if (this->title)
+    delete []this->title;
+  this->title = new char[strlen(title)+1];
+  strcpy(this->title, title);
 }
 
@@ -571,5 +941,5 @@
    \brief Creates a new horizontal Box
 */
-Box::Box (void)
+Box::Box(void)
 {
   this->init('h');
@@ -580,7 +950,15 @@
    \param boxtype if 'v' the Box will be vertically, if 'h' the Box will be horizontally
 */
-Box::Box (char boxtype)
+Box::Box(char boxtype)
 {
   this->init(boxtype);
+}
+
+/**
+   \brief destructs a Box.
+*/
+Box::~Box(void)
+{
+  this->destroy();
 }
 
@@ -591,5 +969,5 @@
 void Box::init(char boxtype)
 {
-  isOption = -2;
+  this->isOption = -2;
 
   static_cast<Packer*>(this)->init();
@@ -597,12 +975,24 @@
   if (boxtype == 'v')
     {
-      widget = gtk_vbox_new (FALSE, 0);
+      this->widget = gtk_vbox_new(FALSE, 0);
     }
   else
     {
-      widget = gtk_hbox_new (FALSE, 0);
-    }
-#endif /* HAVE_GTK2 */
-
+      this->widget = gtk_hbox_new(FALSE, 0);
+    }
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Destroys a Box.
+*/
+void Box::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the Box: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the Box.\n");
+
+  static_cast<Packer*>(this)->destroy();
 }
 
@@ -613,8 +1003,8 @@
     It does this by apending the first one to its down-pointer and all its following ones to the preceding next-pointer. The last one will receive a NULL pointer as Next
 */
-void Box::fill (Widget *lowerWidget)
-{
-#ifdef HAVE_GTK2
-  gtk_box_pack_start (GTK_BOX (this->widget), lowerWidget->widget, TRUE, TRUE, 0);
+void Box::fill(Widget* lowerWidget)
+{
+#ifdef HAVE_GTK2
+  gtk_box_pack_start(GTK_BOX(this->widget), lowerWidget->widget, TRUE, TRUE, 0);
 #endif /* HAVE_GTK2 */
   if (this->down == NULL)
@@ -624,5 +1014,5 @@
       Widget* tmp;
       tmp = this->down;
-      while (tmp->next != NULL)
+      while(tmp->next != NULL)
 	{
 	  tmp = tmp->next;
@@ -632,33 +1022,15 @@
 }
 
-/* IMAGE */
-
-/**
-   \brief Creates a new Image
-   \param imagename the location of the Image on the Hard Disc
-*/
-Image::Image (char* imagename)
-{
-  this->init();
-  if (label)
-    delete []label;
-  label = new char[strlen(imagename)+1];
-  strcpy(label, imagename);
-
-#ifdef HAVE_GTK2
-  widget = gtk_image_new_from_file (imagename);
-#endif /* HAVE_GTK2 */
-}
-
-/** 
-    \brief Initializes a new Image
-*/
-void Image::init()
-{
-  isOption = 0;
-
-  static_cast<Widget*>(this)->init();
-}
-
+/**
+   \brief Sets the Title of a Box.
+   \param title the new Title to set.
+*/
+void Box::setTitle(char* title)
+{
+  if (this->title)
+    delete []this->title;
+  this->title = new char[strlen(title)+1];
+  strcpy(this->title, title);
+}
 
 /* OPTION */
@@ -668,15 +1040,29 @@
    sets all Option-Specific-Values to their defaults.
 */
-void Option::init()
-{
-  value = 0;
-  flagName = NULL;
-  flagNameShort = NULL;
-  saveable = false;
-  defaultValue = 0;
+void Option::init(void)
+{
+  this->value = 0;
+  this->flagName = NULL;
+  this->flagNameShort = NULL;
+  this->saveable = false;
+  this->defaultValue = 0;
 
   static_cast<Widget*>(this)->init();
 
   return;
+}
+
+/**
+   \brief Destroys an Option.
+*/
+void Option::destroy(void)
+{ 
+  PRINTF(4)("deleting the Option Part.\n");
+  if (this->flagName)
+    delete []this->flagName;
+  if (this->flagNameShort)
+    delete []this->flagNameShort;
+
+  static_cast<Widget*>(this)->destroy();
 }
 
@@ -685,37 +1071,75 @@
    !! Options will be saved if flagname is different from NULL !!
    \param flagname the Name that will be displayed in the output
-   \param defaultvalue the default Value for this Option (see definition of defaultvalue
-*/
-void Option::setFlagName (char* flagname, int defaultvalue)
-{
-  if (flagName)
-    delete flagName;
-  flagName = new char [strlen(flagname)+1];
-  strcpy(flagName, flagname);
-  defaultValue = defaultvalue;
-
-  //  cout << "Set Flagname of " << label << " to " << flagname << endl;
+   \param defaultvalue the default Value for this Option(see definition of defaultvalue
+*/
+void Option::setFlagName(char* flagname, int defaultvalue)
+{
+  if (this->flagName)
+    delete this->flagName;
+  this->flagName = new char [strlen(flagname)+1];
+  strcpy(this->flagName, flagname);
+  this->defaultValue = defaultvalue;
+
+  //  cout << "Set Flagname of " << this->title << " to " << flagname << endl;
 }
 
 /** 
-    \brief see Option::setFlagName (char* flagname, int defaultvalue)
+    \brief see Option::setFlagName(char* flagname, int defaultvalue)
     \param flagname the Name that will be displayed in the output
-    \param defaultvalue the default Value for this Option (see definition of defaultvalue
+    \param defaultvalue the default Value for this Option(see definition of defaultvalue
     \param flagnameshort a short flagname to be displayed in the output
 */
-void Option::setFlagName (char* flagname, char* flagnameshort,  int defaultvalue)
-{
-  if (flagName)
-    delete flagName;
-  flagName = new char [strlen(flagname)+1];
-  strcpy(flagName, flagname);
-
-  if (flagNameShort)
-    delete flagNameShort;
-  flagNameShort = new char [strlen(flagnameshort)+1];
-  strcpy(flagNameShort, flagnameshort);
-  defaultValue = defaultvalue;
-  //  cout << "Set Flagname of " << label << " to " << flagname << endl;
-}
+void Option::setFlagName(char* flagname, char* flagnameshort,  int defaultvalue)
+{
+  if (this->flagName)
+    delete []this->flagName;
+  this->flagName = new char [strlen(flagname)+1];
+  strcpy(this->flagName, flagname);
+
+  if (this->flagNameShort)
+    delete []this->flagNameShort;
+  this->flagNameShort = new char [strlen(flagnameshort)+1];
+  strcpy(this->flagNameShort, flagnameshort);
+  this->defaultValue = defaultvalue;
+  //  cout << "Set Flagname of " << this->title << " to " << flagname << endl;
+}
+
+/**
+   \brief Sets the saveable-state of the option to true.
+*/
+void Option::saveability(void)
+{
+  this->saveable = true;
+}
+
+/**
+   \brief Sets the saveable-state of the option.
+   \param isSaveable the saveable-state to set.
+*/
+void Option::saveability(bool isSaveable)
+{
+  this->saveable = isSaveable;
+}
+
+/**
+   \returns The saveable-state.
+*/
+bool Option::isSaveable(void)
+{
+  return this->saveable;
+}
+
+#ifdef HAVE_GTK2
+/** 
+    \brief Signal OptionChange writes the Value from the Slider to its Object-Database.
+    \param widget The widget(Slider) that has a changed Value
+    \param slider the Slider-Object that should receive the change.
+*/
+gint Option::OptionChange(GtkWidget *widget, Widget* option)
+{
+  static_cast<Option*>(option)->changeOption();
+  flags->setTextFromFlags(Window::mainWindow);  //// must be different !!!
+}
+#endif /* HAVE_GTK2 */
 
 
@@ -733,4 +1157,12 @@
 
 /**
+   \brief destructs a Button.
+*/
+Button::~Button(void)
+{
+  this->destroy();
+}
+
+/**
    \brief Initializes a new Button
 */
@@ -742,6 +1174,19 @@
 
 #ifdef HAVE_GTK2
-  widget = gtk_button_new_with_label ("");
-#endif /* HAVE_GTK2 */
+  widget = gtk_button_new_with_label("");
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Destroys a Button.
+*/
+void Button::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the Label: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the Label.\n");
+
+  static_cast<Option*>(this)->destroy();
 }
 
@@ -750,12 +1195,12 @@
    \param title The name the Button should get
 */
-void Button::setTitle (char *title)
-{
-  if (label)
-    delete []label;
-  label = new char[strlen(title)+1];
-  strcpy(label, title);
-#ifdef HAVE_GTK2
-  gtk_button_set_label (GTK_BUTTON(widget), title);
+void Button::setTitle(char *title)
+{
+  if (this->title)
+    delete []this->title;
+  this->title = new char[strlen(title)+1];
+  strcpy(this->title, title);
+#ifdef HAVE_GTK2
+  gtk_button_set_label(GTK_BUTTON(widget), title);
 #endif /* HAVE_GTK2 */
 }
@@ -765,6 +1210,16 @@
    not implemented yet
 */
-void Button::redraw ()
-{
+void Button::redraw(void)
+{
+}
+
+/**
+   \brief Button can not be changed, optionChange is empty)
+
+   \todo Actions for non-GTK-mode
+*/
+void Button::changeOption(void)
+{
+  // This will possibly be used for ACTIONS !
 }
 
@@ -775,5 +1230,5 @@
    \param buttonname The name the CheckButton should display.
 */
-CheckButton::CheckButton (char* buttonname)
+CheckButton::CheckButton(char* buttonname)
 {
   this->init();
@@ -781,6 +1236,14 @@
 
 #ifdef HAVE_GTK2
-  this->connectSignal ("clicked", this->OptionChange);
-#endif /* HAVE_GTK2 */
+  this->connectSignal("clicked", this->OptionChange);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief destructs a CheckButton.
+*/
+CheckButton::~CheckButton(void)
+{
+  this->destroy();
 }
 
@@ -790,11 +1253,24 @@
 void CheckButton::init(void)
 {
-  isOption = 1;
+  this->isOption = 1;
 
   static_cast<Option*>(this)->init();
 
 #ifdef HAVE_GTK2
-  widget = gtk_check_button_new_with_label ("");
-#endif /* HAVE_GTK2 */
+  this->widget = gtk_check_button_new_with_label("");
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Destroys a CheckButton.
+*/
+void CheckButton::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the CheckButton: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the CheckButton.\n");
+
+  static_cast<Option*>(this)->destroy();
 }
 
@@ -805,8 +1281,8 @@
 void CheckButton::setTitle(char* title)
 {
-  if (label)
-    delete []label;
-  label = new char[strlen(title)+1];
-  strcpy(label, title);
+  if (this->title)
+    delete []this->title;
+  this->title = new char[strlen(title)+1];
+  strcpy(this->title, title);
 #ifdef HAVE_GTK2
   gtk_button_set_label(GTK_BUTTON(widget), title);
@@ -814,5 +1290,5 @@
 }
 
-bool CheckButton::isActive()
+bool CheckButton::isActive(void)
 {
 #ifdef HAVE_GTK2
@@ -821,26 +1297,31 @@
 }
 
-#ifdef HAVE_GTK2
-/** 
-    \brief Signal OptionChange writes the Value from the CheckButton to its Object-Database.
-    \param widget The widget(CheckButton) that has a changed Value
-    \param checkbutton the CheckButton-Object that should receive the change.
-*/
-gint CheckButton::OptionChange (GtkWidget *widget, Widget* checkbutton)
-{
-  static_cast<CheckButton*>(checkbutton)->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ((CheckButton*)checkbutton->widget));
-  flags->setTextFromFlags(orxonoxGUI);   ////// must be different!!!
-  cout << static_cast<CheckButton*>(checkbutton)->label << " set to: " << static_cast<CheckButton*>(checkbutton)->value << endl;
-}
-#endif /* HAVE_GTK2 */
-
-/**
-   \brief Redraws the CheckButton (if option has changed).
+/**
+   \brief Changed the Option, call this Function
+*/
+void CheckButton::changeOption(void)
+{
+#ifdef HAVE_GTK2
+  this->value =(int)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(this->widget));
+#else /* HAVE_GTK2 */
+  char tmpChar[20];
+  cout << "\nPlease give me a new value for " << this->title << " [0,1](defualt:" << this->defaultValue << "): ";
+  cin >> tmpChar;
+
+  if ((this->value = atoi(tmpChar))=!0)
+    this->value = 1;
+#endif /* HAVE_GTK2 */
+  cout << this->title << " set to: " << this->value << endl;
+}
+
+
+/**
+   \brief Redraws the CheckButton(if option has changed).
    Example: if new settings are loaded the Button must be redrawn for the GUI to display that Change
 */
-void CheckButton::redraw ()
-{
-#ifdef HAVE_GTK2
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), value);
+void CheckButton::redraw(void)
+{
+#ifdef HAVE_GTK2
+  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(this->widget), value);
 #endif /* HAVE_GTK2 */
 }
@@ -854,5 +1335,5 @@
    \param end The maximal Value of the slider.
 */
-Slider::Slider (char* slidername, int start, int end)
+Slider::Slider(char* slidername, int start, int end)
 {
   this->init(start, end);
@@ -860,21 +1341,45 @@
   this->setTitle(slidername);
 #ifdef HAVE_GTK2
-  this->connectSignal ("value_changed", this->OptionChange);
-#endif /* HAVE_GTK2 */
+  this->connectSignal("value_changed", this->OptionChange);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief destructs a Slider.
+*/
+Slider::~Slider(void)
+{
+  this->destroy();
 }
 
 /**
    \brief Initializes a Slider with start and end Values
-   params: see Slider::Slider (char* slidername, int start, int end)
+   params: see Slider::Slider(char* slidername, int start, int end)
 */
 void Slider::init(int start, int end)
 {
-  isOption = 2;
+  this->isOption = 2;
 
   static_cast<Option*>(this)->init();
 
-#ifdef HAVE_GTK2
- widget = gtk_hscale_new_with_range (start, end, 5);
-#endif /* HAVE_GTK2 */
+  this->start = start;
+  this->end = end;
+#ifdef HAVE_GTK2
+ widget = gtk_hscale_new_with_range(this->start, this->end, 5);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Destroys a Slider.
+*/
+void Slider::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the Slider: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the Slider.\n");
+
+  static_cast<Option*>(this)->destroy();
+
 }
 
@@ -885,8 +1390,8 @@
 void Slider::setTitle(char* title)
 {
-  if (label)
-    delete []label;
-  label = new char[strlen(title)+1];
-  strcpy(label, title);
+  if (this->title)
+    delete []this->title;
+  this->title = new char[strlen(title)+1];
+  strcpy(this->title, title);
 }
 
@@ -900,27 +1405,33 @@
 }
 
-#ifdef HAVE_GTK2
-/** 
-    \brief Signal OptionChange writes the Value from the Slider to its Object-Database.
-    \param widget The widget(Slider) that has a changed Value
-    \param slider the Slider-Object that should receive the change.
-*/
-gint Slider::OptionChange (GtkWidget *widget, Widget* slider)
-{
-  static_cast<Slider*>(slider)->value = (int)gtk_range_get_value (GTK_RANGE ((Slider*)slider->widget));
-  flags->setTextFromFlags(orxonoxGUI);  //// must be different !!!
-  cout << static_cast<Slider*>(slider)->label << " set to: "<< static_cast<Slider*>(slider)->value << endl;
-}
-#endif /* HAVE_GTK2 */
-
 /**
    \brief Redraws the widget
-   Example: see void CheckButton::redraw ()
-*/
-void Slider::redraw ()
-{
-#ifdef HAVE_GTK2
-  gtk_range_set_value (GTK_RANGE (widget), value);
-#endif /* HAVE_GTK2 */
+   Example: see void CheckButton::redraw(void)
+*/
+void Slider::redraw(void)
+{
+#ifdef HAVE_GTK2
+  gtk_range_set_value(GTK_RANGE(this->widget), value);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Changed the Option, call this Function
+*/
+void Slider::changeOption(void)
+{
+#ifdef HAVE_GTK2
+  this->value =(int)gtk_range_get_value(GTK_RANGE(this->widget));
+#else /* HAVE_GTK2 */
+  char tmpChar[20];
+  cout << "\nPlease give me a new value for " << this->title << " [" <<this->start << "-" << this->end << "](defualt:" << this->defaultValue << "): ";
+  cin >> tmpChar;
+
+  if ((this->value = atoi(tmpChar))> this->end)
+    this->value = this->end;
+  if (this->value <= this->start)
+    this->value = this->start;
+#endif /* HAVE_GTK2 */
+  cout << this->title << " set to: " << this->value << endl;
 }
 
@@ -933,5 +1444,5 @@
     \param ... items to be added to this Menu. !! Consider, that the last input argument has to be "lastItem" for this to work!!
 */
-Menu::Menu (char* menuname, ...)
+Menu::Menu(char* menuname, ...)
 {
   this->init();
@@ -941,6 +1452,6 @@
 
 #ifdef HAVE_GTK2             /////////////////////// REINPLEMENT
-  va_start (itemlist, menuname);
-  while (strcmp (itemName = va_arg (itemlist, char*), "lastItem"))
+  va_start(itemlist, menuname);
+  while(strcmp(itemName = va_arg(itemlist, char*), "lastItem"))
     {
       this->addItem(itemName);
@@ -950,7 +1461,15 @@
 
 #ifdef HAVE_GTK2
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (widget), menu);
-  this->connectSignal ("changed", this->OptionChange);
-#endif /* HAVE_GTK2 */
+  gtk_option_menu_set_menu(GTK_OPTION_MENU(this->widget), menu);
+  this->connectSignal("changed", this->OptionChange);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief destructs a Menu.
+*/
+Menu::~Menu(void)
+{
+  this->destroy();
 }
 
@@ -960,14 +1479,29 @@
 void Menu::init(void)
 {
-  isOption = 2;
+  this->isOption = 2;
 
   static_cast<Option*>(this)->init();
 
 #ifdef HAVE_GTK2
-  widget = gtk_option_menu_new ();
-  menu = gtk_menu_new ();
-#endif /* HAVE_GTK2 */
-
-}
+  this->widget = gtk_option_menu_new();
+  this->menu = gtk_menu_new();
+#endif /* HAVE_GTK2 */
+
+}
+
+/**
+   \brief Destroys a Menu.
+*/
+void Menu::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the Menu: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the Menu.\n");
+  //! \todo destroy menu
+  
+  static_cast<Option*>(this)->destroy();
+}
+
 
 /**
@@ -977,8 +1511,8 @@
 void Menu::setTitle(char* title)
 {
-  if (label)
-    delete []label;
-  label = new char[strlen(title)+1];
-  strcpy(label, title);
+  if (this->title)
+    delete []this->title;
+  this->title = new char[strlen(title)+1];
+  strcpy(this->title, title);
 }
 
@@ -986,48 +1520,63 @@
    \brief appends a new Item to the Menu-List.
    \param itemName the itemName to be appendet.
-*/
-void Menu::addItem (char* itemName)
-{
-#ifdef HAVE_GTK2
-  item = gtk_menu_item_new_with_label (itemName);
-  gtk_menu_shell_append(GTK_MENU_SHELL (menu), item);
-#endif /* HAVE_GTK2 */
-}
-
-#ifdef HAVE_GTK2
-/** 
-    \brief Signal OptionChange writes the Value from the Menu to its Object-Database.
-    \param widget The widget(Menu) that has a changed Value
-    \param menu the Menu-Object that should receive the change.
-*/
-gint Menu::OptionChange (GtkWidget *widget, Widget* menu)
-{
-  static_cast<Menu*>(menu)->value = (int)gtk_option_menu_get_history (GTK_OPTION_MENU (menu->widget));
-  flags->setTextFromFlags(orxonoxGUI); //// must be different !!!
-  cout << static_cast<Menu*>(menu)->label << " changed to : " << static_cast<Menu*>(menu)->value << endl;
-}
-#endif /* HAVE_GTK2 */
+
+   \todo make the item-list readable without GTK
+*/
+void Menu::addItem(char* itemName)
+{
+#ifdef HAVE_GTK2
+  this->item = gtk_menu_item_new_with_label(itemName);
+  gtk_menu_shell_append(GTK_MENU_SHELL(this->menu), this->item);
+#endif /* HAVE_GTK2 */
+}
 
 /**
    \brief Redraws the widget
-   Example: see void CheckButton::redraw ()
-*/
-void Menu::redraw ()
-{
-#ifdef HAVE_GTK2
- gtk_option_menu_set_history (GTK_OPTION_MENU (widget), value);
-#endif /* HAVE_GTK2 */
-}
+   Example: see void CheckButton::redraw(void)
+*/
+void Menu::redraw(void)
+{
+#ifdef HAVE_GTK2
+ gtk_option_menu_set_history(GTK_OPTION_MENU(this->widget), this->value);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Changed the Option, call this Function
+*/
+void Menu::changeOption(void)
+{
+#ifdef HAVE_GTK2
+  this->value =(int)gtk_option_menu_get_history(GTK_OPTION_MENU(this->widget));
+#else /* HAVE_GTK2 */
+  char tmpChar[20];
+  cout << "\nPlease give me a new value for " << this->title << "(defualt:" << this->defaultValue << "): ";
+  cin >> tmpChar;
+  this->value = atoi(tmpChar);
+
+#endif /* HAVE_GTK2 */
+  cout << this->title << " set to: " << this->value << endl;
+}
+
+/* OPTION LABEL */
 
 /**
    \brief Creates a new OptionLabel with a LabelName and a Value.
    \param label The name of the OptionLabel.
-   \param value The Value of the OptionLabel (what will be displayed).
+   \param value The Value of the OptionLabel(what will be displayed).
 */
 OptionLabel::OptionLabel(char* label, char* value)
 {
-  init();
-  setTitle(label);
-  setValue(value);
+  this->init();
+  this->setTitle(label);
+  this->setValue(value);
+}
+
+/**
+   \brief destructs an OptionLabel.
+*/
+OptionLabel::~OptionLabel(void)
+{
+  this->destroy();
 }
 
@@ -1037,12 +1586,29 @@
 void OptionLabel::init(void)
 {
+  this->isOption = 5;
   static_cast<Option*>(this)->init();
-  isOption = 5;
+
   cValue = NULL;
 
 #ifdef HAVE_GTK2
-  widget = gtk_label_new ("");
-#endif /* HAVE_GTK2 */
-}
+  this->widget = gtk_label_new("");
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Destroys a OptionLabel.
+*/
+void OptionLabel::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the OptionLabel: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the OptionLabel.\n");
+  if (this->cValue)
+    delete []this->cValue;
+
+  static_cast<Option*>(this)->destroy();
+}
+
 
 /**
@@ -1052,10 +1618,10 @@
 void OptionLabel::setValue(char* newValue)
 {
-  if (cValue)
-    delete cValue;
-  cValue = new char [strlen(newValue)+1];
-  strcpy(cValue, newValue);
-#ifdef HAVE_GTK2
-  gtk_label_set_text (GTK_LABEL (widget), cValue);
+  if (this->cValue)
+    delete []this->cValue;
+  this->cValue = new char [strlen(newValue)+1];
+  strcpy(this->cValue, newValue);
+#ifdef HAVE_GTK2
+  gtk_label_set_text(GTK_LABEL(this->widget), this->cValue);
 #endif /* HAVE_GTK2 */
 }
@@ -1067,20 +1633,35 @@
 void OptionLabel::setTitle(char* title)
 {
-  if (label)
-    delete []label;
-  label = new char [strlen(title)+1];
-  strcpy(label, title);
-#ifdef HAVE_GTK2
-  gtk_label_set_text (GTK_LABEL (widget), title);
-#endif /* HAVE_GTK2 */
-}
-
-/**
-   \brief Redraws an OptionLabel (not implemented yet, but it works).
+  if (this->title)
+    delete []this->title;
+  this->title = new char [strlen(title)+1];
+  strcpy(this->title, title);
+  this->redraw();
+}
+
+/**
+   \brief Redraws an OptionLabel(not implemented yet, but it works).
 */
 void OptionLabel::redraw(void)
 {
-  
-}
+#ifdef HAVE_GTK2
+  gtk_label_set_text(GTK_LABEL(widget), title);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Changed the Option, call this Function
+*/
+void OptionLabel::changeOption(void)
+{
+#ifdef HAVE_GTK2
+  this->cValue =(char*)gtk_label_get_text(GTK_LABEL(this->widget));
+#else /* HAVE_GTK2 */
+  cout << "\nPlease give me a new input for " << this->title << ": ";
+  cin >> this->cValue;
+#endif /* HAVE_GTK2 */
+  cout << this->title << " set to: " << this->cValue << endl;
+}
+
 
 /**
@@ -1088,5 +1669,5 @@
    You migth consider adding Label::setTitle with this.
 */
-Label::Label ()
+Label::Label(void)
 {
   this->init();
@@ -1097,8 +1678,16 @@
    \param text The text to be displayed.
 */
-Label:: Label (char* text)
+Label:: Label(char* text)
 {
   this->init();
-  this->setText(text);
+  this->setTitle(text);
+}
+
+/**
+   \brief destructs a Label.
+*/
+Label::~Label(void)
+{
+  this->destroy();
 }
 
@@ -1108,12 +1697,25 @@
 void Label::init(void)
 {
-  isOption = 0;
+  this->isOption = 0;
 
   static_cast<Widget*>(this)->init();
 
 #ifdef HAVE_GTK2
-  widget = gtk_label_new ("");
-  gtk_label_set_line_wrap (GTK_LABEL(widget), TRUE);
-#endif /* HAVE_GTK2 */
+  this->widget = gtk_label_new("");
+  gtk_label_set_line_wrap(GTK_LABEL(this->widget), TRUE);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Destroys a Label.
+*/
+void Label::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the Label: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the Label.\n");
+
+  static_cast<Widget*>(this)->destroy();
 }
 
@@ -1122,14 +1724,60 @@
    \param text The text to be inserted into the Label.
 */
-void Label::setText (char* text)
-{
-  if (label)
-    delete []label;
-  label = new char[strlen(text)+1];
-  strcpy(label, text);
-#ifdef HAVE_GTK2
-  gtk_label_set_text (GTK_LABEL (this->widget), text);
-#endif /* HAVE_GTK2 */
-}
+void Label::setTitle(char* text)
+{
+  if (this->title)
+    delete []this->title;
+  this->title = new char[strlen(text)+1];
+  strcpy(this->title, text);
+#ifdef HAVE_GTK2
+  gtk_label_set_text(GTK_LABEL(this->widget), this->title);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief ereases the Text of a Label
+*/
+void Label::ereaseText(void)
+{
+  this->setTitle("");
+}
+
+/** 
+    \brief appends some Text to a Label
+    \param textToAppend The text that will be appended to this Label
+*/
+void Label::appendText(char* textToAppend)
+{
+  if (this->title)
+    {
+      char* tmpTitle = new char[strlen(this->title)+strlen(textToAppend)+1];
+      strcpy(tmpTitle, title);  
+      strcat(tmpTitle, textToAppend);
+      delete []this->title;
+      this->title = tmpTitle;
+    }
+  else
+    {
+      this->title = new char[strlen(textToAppend)];
+    }
+  
+#ifdef HAVE_GTK2
+  gtk_label_set_text(GTK_LABEL(this->widget), title);
+#endif /* HAVE_GTK2 */
+}
+
+/** 
+    \brief Appends some integer to the Label
+    \param intToAppend The Int that will be added.
+    
+    it does this by just converting the int into a char* and send it to appendText
+*/
+void Label::appendInt(int intToAppend)
+{
+  char append [32];
+  sprintf(append, "%d", intToAppend);
+  this->appendText(append);
+}
+
 
 /**
@@ -1137,6 +1785,167 @@
    \return The Text the Label holds.
 */
-char* Label::getText ()
-{
-  return label;
-}
+char* Label::getText(void)
+{
+  return this->title;
+}
+
+/**
+   \brief Creates a new ProgressBar.
+*/
+ProgressBar::ProgressBar(void)
+{
+  this->init();
+}
+
+/**
+   \brief Creates a new ProgressBar.
+   \param label The name you want to get the ProgressBar.
+*/
+ProgressBar::ProgressBar(char* label)
+{
+  this->init();
+  this->setTitle(label);
+}
+
+/**
+   \brief destructs a ProgressBar
+*/
+ProgressBar::~ProgressBar(void)
+{
+  this->destroy();
+}
+
+/**
+   \brief Initializes a ProgressBar
+*/
+void ProgressBar::init(void)
+{
+  this->isOption = 0;
+  this->progress = 0.0;
+  this->totalSize = 0.0;
+
+  static_cast<Widget*>(this)->init();
+#ifdef HAVE_GTK2
+  this->adjustment =(GtkAdjustment*)gtk_adjustment_new(0, 0, 100, 0, 0, 0);
+  this->widget = gtk_progress_bar_new_with_adjustment(this->adjustment);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief Destroys a ProgressBar.
+*/
+void ProgressBar::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the ProgressBar: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the ProgressBar.\n");
+
+  static_cast<Widget*>(this)->destroy();
+}
+
+/**
+   \brief Sets a ned Title to the ProgressBar.
+   \param title The now title of the ProgressBar.
+*/
+void ProgressBar::setTitle(char* title)
+{
+  if (this->title)
+    delete []this->title;
+  this->title = new char [strlen(title)+1];
+  strcpy(this->title, title);
+}
+
+/**
+   \brief Sets the Total size of the Bar.(ex. The maximum one can download)
+*/
+void ProgressBar::setTotalSize(double totalSize)
+{
+  this->totalSize = totalSize;
+}
+
+/**
+   \brief Sets the progress maximum is this->totalSize
+*/
+void ProgressBar::setProgress(double progress)
+{
+  this->progress = progress;
+
+  if (this->progress > this->totalSize)
+    this->progress = this->totalSize;
+
+#ifdef HAVE_GTK2
+  gtk_progress_set_value(GTK_PROGRESS(widget), this->progress*100.0/this->totalSize);
+#endif /* HAVE_GTK2 */
+  PRINTF(3)("Progress: %f\n", this->progress*100.0/this->totalSize);
+}
+
+/**
+    \brief returns the Progress Status
+*/
+double ProgressBar::getProgress(void)
+{
+  return this->progress;
+}
+
+/* IMAGE */
+
+/**
+   \brief Creates a new Image
+   \param imagename the location of the Image on the Hard Disc
+*/
+Image::Image(char* imagename)
+{
+  this->init();
+  if (this->title)
+    delete []this->title;
+  this->title = new char[strlen(imagename)+1];
+  strcpy(this->title, imagename);
+
+#ifdef HAVE_GTK2
+  widget = gtk_image_new_from_file(imagename);
+#endif /* HAVE_GTK2 */
+}
+
+/**
+   \brief destructs an Image.
+*/
+Image::~Image(void)
+{
+  this->destroy();
+}
+
+/** 
+    \brief Initializes a new Image
+*/
+void Image::init(void)
+{
+  isOption = 0;
+
+  static_cast<Widget*>(this)->init();
+}
+
+/**
+   \brief Destroys a Image.
+*/
+void Image::destroy(void)
+{ 
+  if (this->title)
+    PRINTF(3)("deleting the Image: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the Image.\n");
+
+  static_cast<Widget*>(this)->destroy();
+}
+
+/**
+   \brief Sets a ned Title to the Image.
+   \param title The now title of the OptionLabel.
+*/
+void Image::setTitle(char* title)
+{
+  if (this->title)
+    delete []this->title;
+  this->title = new char [strlen(title)+1];
+  strcpy(this->title, title);
+}
Index: orxonox/trunk/src/gui/orxonox_gui_gtk.h
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_gtk.h	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_gtk.h	(revision 3423)
@@ -3,5 +3,4 @@
  \brief Contains all th different Widgets.
 */
-
 #ifndef _ORXONOX_GUI_GTK_H
 #define _ORXONOX_GUI_GTK_H
@@ -10,4 +9,9 @@
 #include <config.h> 
 #endif
+
+//! verbose level, soon obsolete
+extern int verbose; // soon obsolete here
+
+#include "../debug.h"
 
 #ifdef HAVE_GTK2
@@ -26,11 +30,9 @@
 #include <gtk/gtkimage.h>
 #include <gtk/gtkeventbox.h>
-#endif /* HAVE_GTK2 */
-
-#ifdef HAVE_GTK2
-bool initGTK(int argc, char *argv[]);
-bool mainloopGTK(void);
-#endif /* HAVE_GTK2 */
-
+#include <gtk/gtkprogressbar.h>
+#endif /* HAVE_GTK2 */
+
+bool initGUI(int argc, char* argv[]);
+bool mainloopGUI(void);
 
 //! This is the topmost object that can be displayed all others are derived from it.
@@ -40,35 +42,49 @@
 
  public:
-  ~Widget ();
-
-  Widget* next; //!< next always points to the next Widget in the list. Every Widget has a next one, or has NULL as next
-#ifdef HAVE_GTK2
-  GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains.
-#endif /* HAVE_GTK2 */
-  void init(void);
-  int isOption; //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3: float option, 4:char option, 5: char* option
-  /**
-     \briefdefines isOption states
-  */
+  virtual ~Widget(void);
+  void init(void);
+  void destroy(void);
+
+  void show(void);
+  void hide(void);
+  void setSize(int width, int height);
+  virtual void setTitle(char* title) = 0;  //!< An abstract Function, that sets the title of Widgets.
+
+  Widget* findWidgetByName(char* name, unsigned int depth);
+  void walkThrough(void(*function)(Widget*), unsigned int depth);
+  void walkThrough(void(*function)(Widget*, void*), void* data, unsigned int depth);
+  static void listOptionsAndGroups(Widget* widget);
+  static void listOptions(Widget* widget);
+  static void listOptions(Widget* widget, void* data);
+  Widget* findOptionByNumber(int* number, unsigned int depth);
+  static void listGroups(Widget* widget);
+  static void listGroups(Widget* widget, void* data);
+  Widget* findGroupByNumber(int* number, unsigned int depth);
+  static void setOptions(Widget* widget);
+  static void flagCheck(Widget* widget, void* flagName);
+  
+#ifdef HAVE_GTK2
+  // Connection - Functions
+
+  gulong connectSignal(char* event, gint(*signal)(GtkWidget*, GdkEvent*, void* ));
+  gulong connectSignal(char* event, gint(*signal)(GtkWidget*, Widget* ));
+  gulong connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, GdkEvent*, void* ));
+  gulong connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, void* ));
+  gulong connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, GdkEventKey*, void* ));
+  void disconnectSignal(gulong signalID);
+
+  // Signals
+  static gint doNothingSignal(GtkWidget* widget, GdkEvent* event, void* nothing);
+#endif /* HAVE_GTK2 */
+
+  Widget* next;                     //!< next always points to the next Widget in the list. Every Widget has a next one, or has NULL as next
+#ifdef HAVE_GTK2
+  GtkWidget* widget;                //!< widget is the gtk_widget that the specific Object Contains.
+#endif /* HAVE_GTK2 */
+  int isOption;                     //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3: float option, 4:char option, 5: char* option
+
+  //! defines isOption states
   enum option { containerType = -2, boxType = -1, nothingType = 0, boolType = 1, intType = 2}; 
-  char* label; //!< The name of the Widget. Some do display it, Options need it to save;
-#ifdef HAVE_GTK2
-  gulong connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *));
-  gulong connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *));
-  gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *));
-  gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *));
-  void disconnectSignal (gulong signalID);
-#endif /* HAVE_GTK2 */
-  void show ();
-  void hide ();
-  void setSize(int width, int height);
-
-  void walkThrough (void (*function)(Widget*));
-  static void listOptions (Widget* widget);
-  static void setOptions (Widget* widget);
-  
-#ifdef HAVE_GTK2
-  static gint doNothingSignal (GtkWidget *widget, GdkEvent* event, void* nothing);
-#endif /* HAVE_GTK2 */
+  char* title;                      //!< The name of the Widget. Some do display it, Options need it to save;
 };
 
@@ -81,6 +97,10 @@
 
   void init(void);
-  void setGroupName (char* name);
-  char* getGroupName (void);
+  void destroy(void);
+
+  void setGroupName(char* name);
+  char* getGroupName(void);
+
+  virtual void fill(Widget* lowerWidget) = 0; //!< An abstract function, that fills Packers.
 };
 
@@ -94,12 +114,14 @@
 {
  private:
-  int borderwidth;
-  int policy;
-  
- public:
-  void init(void);
-  //  void setBorderWidth (int borderwidth);
-  //  virtual void setTitle (char* title) = 0;
-  void fill (Widget *lowerWidget);
+  int borderwidth;          //!< The width of The Container Boarder.
+  int policy;               //!< The Update Policy of a Container.
+  
+ public:
+  void init(void);
+  void destroy(void);
+
+  //  void setBorderWidth(int borderwidth);
+  //  virtual void setTitle(char* title) = 0;
+  void fill(Widget* lowerWidget);
 };
 
@@ -112,22 +134,24 @@
 {
  private:
-  bool isOpen;                //!< A bool Variable that checks if a Window is already open.
- public:
-  static Window* mainWindow;  //!< Pointer to the First Window that was opened. By default this should be the GUI's main-Window.
+  bool isOpen;                      //!< A bool Variable that checks if a Window is already open.
+ public:
+  static Window* mainWindow;        //!< Pointer to the First Window that was opened. By default this should be the GUI's main-Window.
   static void addWindow(Window* windowToAdd);
 
-  Window (void);
-  Window (char* windowName);
-  void init ();
-  
-  void setTitle (char* title);
-  void showall ();
-  void open();
-  void close();
-
-#ifdef HAVE_GTK2
-  static gint windowOpen (GtkWidget *widget, GdkEvent* event, void* window);
-  static gint windowClose (GtkWidget *widget, GdkEvent* event, void* window);
-  static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
+  Window(void);
+  Window(char* windowName);
+  ~Window(void);
+  void init(void);
+  void destroy(void);
+  
+  void setTitle(char* title);
+  void showall(void);
+  void open(void);
+  void close(void);
+
+#ifdef HAVE_GTK2
+  // Signals
+  static gint windowOpen(GtkWidget* widget, GdkEvent* event, void* window);
+  static gint windowClose(GtkWidget* widget, GdkEvent* event, void* window);
 #endif /* HAVE_GTK2 */
 };
@@ -141,9 +165,11 @@
 {
  public:
-  Frame (char* frameName);
-  Frame (void);
-  void init(void);
-  
-  void setTitle (char* title);
+  Frame(void);
+  Frame(char* frameName);
+  ~Frame(void);
+  void init(void);
+  void destroy(void);
+  
+  void setTitle(char* title);
 };
 
@@ -155,9 +181,11 @@
 {
  public:
-  EventBox (char* eventBoxName);
-  EventBox (void);
-  void init(void);
-  
-  void setTitle (char* title);
+  EventBox(void);
+  EventBox(char* eventBoxName);
+  ~EventBox(void);
+  void init(void);
+  void destroy(void);
+  
+  void setTitle(char* title);
 };
 
@@ -166,15 +194,187 @@
    A Box can Contain multiple Widgets, that are ordered either horizontally or vertically
    I defined the standartbox to be horizontally.
-   A Box is always filled left->right (horizontally) or up->down (vertically)
+   A Box is always filled left->right(horizontally) or up->down(vertically)
 */
 class Box : public Packer
 {
  public:
-  Box (void);
-  Box (char boxtype);
+  Box(void);
+  Box(char boxtype);
+  ~Box(void);
   void init(char boxtype);
-
-  void fill (Widget* lowerWidget);
-
+  void destroy(void);
+  
+  void fill(Widget* lowerWidget);
+
+  void setTitle(char* title);
+};
+
+//! An Option is a Widget that contains something that may change its state.
+/**
+ * Options are the essence of a GUI, they: Configure, Start, Quit, Execute, and make it worth something
+ */
+class Option : public Widget
+{
+ protected:
+  bool saveable;  //!< Options can be Saved.
+  
+ public:
+  void init(void);
+  void destroy(void);
+
+  int value; //!< every option has a value either true or false(0,1) or something else like 25 for 25% of the volume
+  char* flagName; //!< options have a flag name that will be appendet if you start the Program from the GUI.
+  char* flagNameShort; //!< like flag_name but shorter
+  int defaultValue; //!< A default value is good, for hiding a option if it is not needed.(hidden if value == default_value)
+
+  void saveability(void);
+  void saveability(bool isSaveable);
+  bool isSaveable(void);
+  void setFlagName(char* flagname, int defaultvalue);
+  void setFlagName(char* flagname, char* flagnameshort, int defaultvalue);
+  virtual void redraw(void) = 0; //!< A Option must be able to redraw itself.
+  virtual void changeOption(void) = 0; //!< What to do, if an Option is Changed. eacht option decides for itself.
+#ifdef HAVE_GTK2
+    // Signals  
+  static gint OptionChange(GtkWidget* widget, Widget* option); //!< Signal for Options that change.
+#endif /* HAVE_GTK2 */
+};
+
+//! Buttons can be pressed, and released.
+/**
+ * Buttons are mainly there for executing some action like Starting the Programm, or Quiting it.
+ */
+class Button : public Option 
+{
+ public:
+  Button(char* buttonname);
+  ~Button(void);
+  void init(void);
+  void destroy(void);
+
+  void setTitle(char* title);
+  void redraw(void);
+  void changeOption(void);
+};
+
+//! CheckButtons are a key in configuring bool Variables
+/** CheckButtons can configure bool Variables like wireframe on/off, enable_sound etc.
+ */
+class CheckButton : public Option
+{
+ public:
+  CheckButton(char* buttonname);
+  ~CheckButton(void);
+  void init(void);
+  void destroy(void);
+
+  void setTitle(char* title);
+  bool isActive(void);           //!< a Bool value to see, if this CheckButton is active.
+  void redraw(void);
+  void changeOption(void);
+};
+
+//! Sliders are Options that can be modified in their value
+/**
+ * good for volume, brightness, etc.
+ */
+class Slider : public Option
+{
+ private:
+  int start;                            //!< The beginning of the Slider-range.
+  int end;                              //!< The end of the Slider-range.
+ public:
+  Slider(char* slidername, int start, int end);
+  ~Slider(void);
+  void init(int start, int end);
+  void destroy(void);
+
+  void setTitle(char* title);
+  void setValue(int value);
+  void redraw(void);
+  void changeOption(void);
+};
+
+//! A Menu is an Option that has a dropdown menu, where you can chose between different Items
+class Menu : public Option
+{
+ private:
+#ifdef HAVE_GTK2
+  GtkWidget* menu;                      //!< The menu That will hold the Options.
+  GtkWidget* item;                      //!< One Item From a Menu.
+#endif /* HAVE_GTK2 */
+  va_list itemlist;                     //!< The list to readin multiple Options.
+  
+ public:
+  Menu(char* menuname, ...);
+  ~Menu(void);
+  void init(void);
+  void destroy(void);
+  
+  void setTitle(char* title);
+  void addItem(char* itemName);
+  void redraw(void);
+  void changeOption(void);
+};
+
+//! A OptionLabel is a simple Label, that holds a char*, and will be updated, if changed.
+class OptionLabel : public Option
+{
+ private:
+
+ public:
+  OptionLabel(char* label, char* value);
+  ~OptionLabel(void);
+  void init(void);
+  void destroy(void);
+  
+  
+  void setValue(char* newValue);
+  void setTitle(char* title);
+  void redraw(void);
+  void changeOption(void);
+
+  char* cValue;                          //!< The Value the Label will have. \todo make private
+
+};
+
+//! A label is a Widget, that displays a text
+class Label : public Widget
+{
+ public:
+  Label(void);
+  Label(char* text);
+  ~Label(void);
+  void init(void);
+  void destroy(void);
+  
+  void setTitle(char* text);
+  void ereaseText(void);
+  void appendText(char* textToAppend);
+  void appendInt(int intToAppend);
+  char* getText(void);
+};
+
+//! A ProgressBar is a Widget, that can display a Progress
+class ProgressBar : public Widget
+{
+ public:
+  ProgressBar(void);
+  ProgressBar(char* label);
+  ~ProgressBar(void);
+  void init(void);
+  void destroy(void);
+
+  void setTitle(char* title);
+  void setProgress(double progress);
+  void setTotalSize(double totalSize);
+  double getProgress(void);
+
+ private:
+  double totalSize;         //!< The total Size of a download Bar
+  double progress;          //!< The progress of a Bar.
+#ifdef HAVE_GTK2
+  GtkAdjustment* adjustment;
+#endif /* HAVE_GTK2 */
 };
 
@@ -187,132 +387,13 @@
 {
  public:
-  Image (char* imgaename);
-  void init(void);
-};
-
-//! An Option is a Widget that contains something that may change its state.
-/**
- * Options are the essence of a GUI, they: Configure, Start, Quit, Execute, and make it worth something
- */
-class Option : public Widget
-{
- public:
-  //virtual gint OptionChange (GtkWidget *widget, GdkEvent *event, gpointer data);
-  void init(void);
-
-  int value; //!< every option has a value either true or false (0,1) or something else like 25 for 25% of the volume
-  char* flagName; //!< options have a flag name that will be appendet if you start the Program from the GUI.
-  char* flagNameShort; //!< like flag_name but shorter
-  int defaultValue; //!< A default value is good, for hiding a option if it is not needed. (hidden if value == default_value)
-  bool saveable;  //!< Options can be Saved.
-
-  void setFlagName (char* flagname, int defaultvalue);
-  void setFlagName (char* flagname, char* flagnameshort, int defaultvalue);
-  virtual void redraw () = 0; //!< A Option must be able to redraw itself.
-};
-
-//! Buttons can be pressed, and released.
-/**
- * Buttons are mainly there for executing some action like Starting the Programm, or Quiting it.
- */
-class Button : public Option 
-{
- public:
-  Button (char* buttonname);
-  void init(void);
-
-  void setTitle(char* title);
-  
-  void redraw();
-};
-
-//! CheckButtons are a key in configuring bool Variables
-/** CheckButtons can configure bool Variables like wireframe on/off, enable_sound etc.
- */
-class CheckButton : public Option
-{
- public:
-  CheckButton (char* buttonname);
-#ifdef HAVE_GTK2
-  static gint OptionChange (GtkWidget* widget, Widget* checkbutton);
-#endif /* HAVE_GTK2 */
-  
-  void init(void);
-  void setTitle(char* title);
-
-  bool isActive();
-  void redraw ();
-};
-
-//! Sliders are Options that can be modified in their value
-/**
- * good for volume, brightness, etc.
- */
-class Slider : public Option
-{
- public:
-  Slider (char* slidername,int start, int end);
-  void init(int start, int end);
-
-  void setTitle(char* title);
-  void setValue(int value);
-
-#ifdef HAVE_GTK2
-  static gint OptionChange (GtkWidget* widget, Widget* slider);
-#endif /* HAVE_GTK2 */
-  void redraw();
-};
-
-//! A Menu is an Option that has a dropdown menu, where you can chose between different Items
-class Menu : public Option
-{
- private:
-#ifdef HAVE_GTK2
-  GtkWidget* menu;     //!< The menu That will hold the Options.
-  GtkWidget* item;     //!< One Item From a Menu.
-#endif /* HAVE_GTK2 */
-  va_list itemlist;    //!> The list to readin multiple Options.
-  
- public:
-  Menu (char* menuname, ...);
-  void init(void);
-
-  void setTitle(char* title);
-
-  void addItem(char* itemName);
-#ifdef HAVE_GTK2
-  static gint OptionChange (GtkWidget* widget, Widget* menu);
-#endif /* HAVE_GTK2 */
-  void redraw();
-};
-
-//! A CharLabel is a simple Label, that holds a char*, and will be updated, if changed.
-class OptionLabel : public Option
-{
- public:
-  OptionLabel(char* label, char* value);
-  void init(void);
-  
-  char* cValue;   //!< The Value the Label will have.
-  
-  void setValue(char* newValue);
-  void setTitle(char* title);
-  void redraw();
-};
-
-//! A label is a Widget, that displays a text
-class Label : public Widget
-{
- public:
-  Label ();
-  Label (char* text);
-  void init(void);
-  
-  void setText (char* text);
-  char* getText ();
-};
-
-
-//gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
+  Image(char* imgaename);
+  ~Image(void);
+  void init(void);
+  void destroy(void);
+
+  void setTitle(char* title);
+};
+
+//gint orxonox_gui_quit(GtkWidget* widget, GdkEvent* event, gpointer data);
 
 #endif /* _ORXONOX_GUI_GTK_H */
Index: orxonox/trunk/src/gui/orxonox_gui_keys.cc
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_keys.cc	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_keys.cc	(revision 3423)
@@ -29,16 +29,24 @@
    \brief Creates an Keyboard-Frame
 */
-OrxonoxGuiKeys::OrxonoxGuiKeys ()
-{
-  keysFrame = new Frame ("Keyboard-Options:");
+OrxonoxGuiKeys::OrxonoxGuiKeys(void)
+{
+  this->keysFrame = new Frame("Keyboard-Options:");
   //  keysFrame->setGroupName("Keyboard");
-  keysBox = new Box ('h');
-  player1 = new Player("player1");
-  player2 = new Player("player2");
-
-  keysBox->fill(player1->getOpenButton());
-  keysBox->fill(player2->getOpenButton());
-
-  keysFrame->fill (keysBox);
+  this->keysBox = new Box('h');
+  this->player1 = new Player("player1");
+  this->player2 = new Player("player2");
+
+  this->keysBox->fill(this->player1->getOpenButton());
+  this->keysBox->fill(this->player2->getOpenButton());
+
+  this->keysFrame->fill(this->keysBox);
+}
+
+/**
+   \brief Destructs the Keys-stuff
+*/
+OrxonoxGuiKeys::~OrxonoxGuiKeys(void)
+{
+  // nothing to do here.
 }
 
@@ -47,7 +55,7 @@
    \return Returns the Audio-frame
 */
-Widget* OrxonoxGuiKeys::getWidget ()
-{
-  return keysFrame;
+Widget* OrxonoxGuiKeys::getWidget(void)
+{
+  return this->keysFrame;
 }
 
@@ -60,42 +68,43 @@
 Player::Player(char* player)
 {
-  char windowName[100] = "Keyboard settings of ";
-  strcat (windowName, player);
-  pKeyWindow = new Window(windowName);
-  pKeyFrame = new Frame (windowName);
-   pKeysBox = new Box('v');
-   pKeysBox->setGroupName (player);
-    pKeysBox->fill(addKey(UP, "up"));
-    pKeysBox->fill(addKey(DOWN, "down"));
-    pKeysBox->fill(addKey(LEFT, "left"));
-    pKeysBox->fill(addKey(RIGHT, "right"));
-    pKeysBox->fill(addKey(SHOOT, "shoot"));
-    
+  char* windowName = new char[strlen(player)+25];
+  strcpy(windowName, "Keyboard settings of ");
+  strcat(windowName, player);
+  this->pKeyWindow = new Window(windowName);
+  this->pKeyFrame = new Frame(windowName);
+   this->pKeysBox = new Box('v');
+   this->pKeysBox->setGroupName(player);
+    this->pKeysBox->fill(addKey(UP, "up"));
+    this->pKeysBox->fill(addKey(DOWN, "down"));
+    this->pKeysBox->fill(addKey(LEFT, "left"));
+    this->pKeysBox->fill(addKey(RIGHT, "right"));
+    this->pKeysBox->fill(addKey(SHOOT, "shoot"));
+    delete windowName;
     closeButton = new Button("close");
 #ifdef HAVE_GTK2
-    closeButton->connectSignal("button_press_event", pKeyWindow, Window::windowClose);
-#endif /* HAVE_GTK2 */
-
-    pKeysBox->fill(closeButton);
-    pKeyFrame->fill(pKeysBox);
-   pKeyWindow->fill(pKeyFrame);
-   Window::addWindow(pKeyWindow);
-#ifdef HAVE_GTK2
-   pKeyWindow->connectSignal("destroy", pKeyWindow, Window::windowClose);
-   pKeyWindow->connectSignal("delete_event", pKeyWindow, Window::windowClose);
-#endif /* HAVE_GTK2 */
-
-  openButton = new Button (player);
-#ifdef HAVE_GTK2
-  openButton->connectSignal("button_press_event", pKeyWindow, Window::windowOpen);
-#endif /* HAVE_GTK2 */
-
-  inputWindow = new Window("inputWindow");
-
-  inputButton = new Button ("test");
-  inputWindow->fill (inputButton);
-#ifdef HAVE_GTK2
-  inputWindow->connectSignal("destroy",  Widget::doNothingSignal);
-  inputWindow->connectSignal("delete_event", Widget::doNothingSignal);
+    this->closeButton->connectSignal("button_press_event", this->pKeyWindow, Window::windowClose);
+#endif /* HAVE_GTK2 */
+
+    this->pKeysBox->fill(this->closeButton);
+    this->pKeyFrame->fill(this->pKeysBox);
+   this->pKeyWindow->fill(this->pKeyFrame);
+   Window::addWindow(this->pKeyWindow);
+#ifdef HAVE_GTK2
+   this->pKeyWindow->connectSignal("destroy", this->pKeyWindow, Window::windowClose);
+   this->pKeyWindow->connectSignal("delete_event", this->pKeyWindow, Window::windowClose);
+#endif /* HAVE_GTK2 */
+
+  this->openButton = new Button(player);
+#ifdef HAVE_GTK2
+  this->openButton->connectSignal("button_press_event", this->pKeyWindow, Window::windowOpen);
+#endif /* HAVE_GTK2 */
+
+  this->inputWindow = new Window("inputWindow");
+
+  this->inputButton = new Button("test");
+  this->inputWindow->fill(inputButton);
+#ifdef HAVE_GTK2
+  this->inputWindow->connectSignal("destroy",  Widget::doNothingSignal);
+  this->inputWindow->connectSignal("delete_event", Widget::doNothingSignal);
 #endif /* HAVE_GTK2 */
 
@@ -108,19 +117,19 @@
    \returns A widget that has the Key-Box
 */
-Widget* Player::addKey (KEYS key, char* name)
-{
-  inputKey[key] = new InputKey;
-  inputKey[key]->pKeyBox = new Box();
-  inputKey[key]->pKeyButton = new Button(name);
-  inputKey[key]->pKeyOLabel = new OptionLabel (name, name);
-  inputKey[key]->pKeyOLabel->saveable = true;
+Widget* Player::addKey(KEYS key, char* name)
+{
+  this->inputKey[key] = new InputKey;
+  this->inputKey[key]->pKeyBox = new Box();
+  this->inputKey[key]->pKeyButton = new Button(name);
+  this->inputKey[key]->pKeyOLabel = new OptionLabel(name, name);
+  this->inputKey[key]->pKeyOLabel->saveability();
 
 #ifdef HAVE_GTK2
   //inputKey[key]->pKeyButton->connectSignal("key_press_event", inputKey[key]->pKeyButton, key_cb);
-  inputKey[key]->pKeyButton->connectSignal("button_press_event", inputKey[key], inputWindowEvent);
-#endif /* HAVE_GTK2 */
-  inputKey[key]->pKeyBox->fill(inputKey[key]->pKeyButton);
-  inputKey[key]->pKeyBox->fill(inputKey[key]->pKeyOLabel);
-  return inputKey[key]->pKeyBox;
+  this->inputKey[key]->pKeyButton->connectSignal("button_press_event", this->inputKey[key], inputWindowEvent);
+#endif /* HAVE_GTK2 */
+  this->inputKey[key]->pKeyBox->fill(this->inputKey[key]->pKeyButton);
+  this->inputKey[key]->pKeyBox->fill(this->inputKey[key]->pKeyOLabel);
+  return this->inputKey[key]->pKeyBox;
 }
 
@@ -128,11 +137,11 @@
    \returns the OpenButton of a Player
 */
-Button* Player::getOpenButton()
-{
-  return openButton;
-}
-
-/**
-   \brief sets a new Key (only output)
+Button* Player::getOpenButton(void)
+{
+  return this->openButton;
+}
+
+/**
+   \brief sets a new Key(only output)
    \param key the new Key.
 */
@@ -163,5 +172,5 @@
 gint Player::key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey)
 {
-  InputKey* inputkey = (InputKey*) inputKey;
+  InputKey* inputkey =(InputKey*) inputKey;
   char title [20];
 
@@ -256,10 +265,10 @@
       char* tmp;
       sprintf(tmp, "%c", event->keyval);
-      printf ("other key %s \n", tmp);
+      printf("other key %s \n", tmp);
       strcpy(title, tmp);
       break;
     }
 
-  inputkey->pKeyOLabel->setValue (title);
+  inputkey->pKeyOLabel->setValue(title);
   inputButton->disconnectSignal(keySignal);
   inputWindow->close();
Index: orxonox/trunk/src/gui/orxonox_gui_keys.h
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_keys.h	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_keys.h	(revision 3423)
@@ -15,5 +15,5 @@
    \brief defines the Possible Player Keys
 */
-enum KEYS { UP, DOWN, LEFT, RIGHT, SHOOT };
+enum KEYS {UP, DOWN, LEFT, RIGHT, SHOOT};
 
 class Player;
@@ -29,8 +29,8 @@
 
  public:
-  OrxonoxGuiKeys ();
-  ~OrxonoxGuiKeys ();
+  OrxonoxGuiKeys(void);
+  ~OrxonoxGuiKeys(void);
   
-  Widget* getWidget ();
+  Widget* getWidget(void);
 };
 
@@ -64,7 +64,7 @@
   Player(char* player);
 
-  Widget* addKey (KEYS key, char* name);
+  Widget* addKey(KEYS key, char* name);
 
-  Button* getOpenButton();
+  Button* getOpenButton(void);
 
 #ifdef HAVE_GTK2
Index: orxonox/trunk/src/gui/orxonox_gui_update.cc
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_update.cc	(revision 3423)
+++ orxonox/trunk/src/gui/orxonox_gui_update.cc	(revision 3423)
@@ -0,0 +1,503 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+   Copyright (C) 2004 orx
+
+   This program is free software; you can 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, or (at your option)
+   any later version.
+
+   This program 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 this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+
+*/
+
+#include "orxonox_gui_update.h"
+#include <iostream>
+#include <string>
+
+#include "orxonox_gui.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+using namespace std;
+
+/**
+   \brief Creates an Update-Frame
+*/
+OrxonoxGuiUpdate::OrxonoxGuiUpdate(void)
+{
+  this->getSystemInfo();
+
+  this->updateFrame = new Frame("Update-Options:");
+  this->updateFrame->setGroupName("update");
+  this->updateBox = new Box('v');
+#ifdef HAVE_CURL
+
+  // the Button for autoUpdating
+  this->autoUpdate = new CheckButton("auto update");
+  this->updateBox->fill(this->autoUpdate);
+  this->autoUpdate->setFlagName("update", "u", 0);
+  this->autoUpdate->saveability();
+
+  this->updateSourceWindowCreate();
+  this->updateBox->fill(this->updateSourceWindowGetButton());
+
+  this->updateDataWindowCreate();
+  this->updateBox->fill(this->updateDataWindowGetButton());
+
+#else /* HAVE_CURL */
+  Label* noCurlLabel = new Label("since you do not have cURL,\nthis option is not availible");
+  this->updateBox->fill(noCurlLabel);  
+#endif /* HAVE_CURL */
+  this->updateFrame->fill(this->updateBox);
+}
+
+/**
+   \brief Destructs the Update-stuff
+*/
+OrxonoxGuiUpdate::~OrxonoxGuiUpdate(void)
+{
+  if(this->tmpDir)
+    delete []this->tmpDir;
+  if(this->homeDir)
+    delete []homeDir;
+  if(this->installDataDir)
+    delete []this->installDataDir;
+  if(this->installSourceDir)
+    delete []this->installSourceDir;
+  if(this->userName)
+    delete []this->userName;
+
+
+}
+
+/**
+   \brief Return the Frame
+   \return Returns the Audio-frame
+*/
+Widget* OrxonoxGuiUpdate::getWidget(void)
+{
+  return this->updateFrame;
+}
+
+/** 
+    \brief Look what info we can get from this system
+*/
+bool OrxonoxGuiUpdate::getSystemInfo(void)
+{
+  PRINTF(3)("Grabbing system information\n");
+  this->tmpDir = getenv("TMPDIR");
+  if(!tmpDir)
+    this->tmpDir = "/tmp";
+  PRINTF(4)("Temporary directory is: %s\n", this->tmpDir);
+
+#ifdef __WIN32__
+  this->homeDir = getenv("USERPROFILE");
+#else
+  this->homeDir = getenv("HOME");
+#endif
+  PRINTF(4)("Home directory is %s\n", homeDir);
+
+  this->installDataDir = "/usr/share/games/orxonox";
+  PRINTF(4)("Installation of orxonox-data will go to this directory: %s\n", this->installDataDir);
+
+  this->installSourceDir = "/usr/games/bin";
+  PRINTF(4)("Installation of orxonox-source will go to this directory: %s\n", this->installSourceDir);
+
+  this->userName = getenv("USER");
+  PRINTF(4)("Logged in username is: %s\n", this->userName);
+}
+
+#ifdef HAVE_CURL
+bool* OrxonoxGuiUpdate::checkForUpdates(void)
+{
+  PRINTF(3)("checking for new version of orxonox\n");
+  FileInfo updateFileInfo;
+  updateFileInfo.fileName = "update_info";
+  updateFileInfo.webRoot = "http://www.orxonox.ethz.ch/files/data";
+  updateFileInfo.localRoot = this->tmpDir;
+  
+  download(&updateFileInfo);
+}
+#endif /* HAVE_CURL */
+#ifdef HAVE_CURL
+/**
+   \brief Creates a window, and all it contains for the Data-update.
+*/
+void OrxonoxGuiUpdate::updateDataWindowCreate(void)
+{
+  this->updateDataWindow = new Window("update orxonox::Data");   
+  this->updateDataBox = new Box('v');
+
+  // the close-Button of the Update Window.
+  //  updateWindowClose = new Button("close");
+#ifdef HAVE_GTK2 
+  //  updateWindowClose->connectSignal("button_press_event", updateWindow, Window::windowClose);
+#endif /* HAVE_GTK2 */
+  //  updateWindowBox->fill(updateWindowClose);
+
+  this->updateDataBar = new ProgressBar();
+  this->updateDataBox->fill(this->updateDataBar);
+
+  FileInfo* dataInfo = new FileInfo;
+  dataInfo->bar = this->updateDataBar;
+
+  this->updateDataBegin = new Button("begin.");
+  dataInfo->stateButton = this->updateDataBegin;
+#ifdef HAVE_GTK2 
+  dataInfo->buttonSignal = updateDataBegin->connectSignal("button_press_event", dataInfo, updateDataFunc);
+#endif /* HAVE_GTK2 */
+  this->updateDataBox->fill(this->updateDataBegin);
+
+  this->updateDataWindow->fill(this->updateDataBox);
+
+  this->updateDataWindowButton = new Button("update orxonox::Data");
+#ifdef HAVE_GTK2 
+  this->updateDataWindowButton->connectSignal("button_press_event", this->updateDataWindow, Window::windowOpen);
+  this->updateDataWindow->connectSignal("destroy", this->updateDataWindow, Window::windowClose);
+  this->updateDataWindow->connectSignal("delete_event", this->updateDataWindow, Window::windowClose);
+#endif /* HAVE_GTK2 */
+
+}
+
+/**
+   \returns A Pointer to the Button of the UpdaterDataWindow
+*/
+Button* OrxonoxGuiUpdate::updateDataWindowGetButton(void)
+{
+  return this->updateDataWindowButton;
+}
+
+/**
+   \brief Creates a window, and all it contains for the Source-update.
+*/
+void OrxonoxGuiUpdate::updateSourceWindowCreate(void)
+{
+  // the button, that opens this Window.
+  this->updateSourceWindowButton = new Button("update orxonox::Source");
+
+  // the Window itself
+  this->updateSourceWindow = new Window("update orxonox::Source");
+
+  this->updateSourceBox = new Box();
+
+  this->updateSourceBar = new ProgressBar();
+  this->updateSourceBox->fill(this->updateSourceBar);
+  test = new Button("increment");
+
+#ifdef HAVE_GTK2 
+  test->connectSignal("button_press_event", updateSourceBar, updateSourceFunc);
+#endif /* HAVE_GTK2 */
+
+  this->updateSourceBox->fill(test);
+  this->updateSourceWindow->fill(updateSourceBox); 
+#ifdef HAVE_GTK2 
+  this->updateSourceWindowButton->connectSignal("button_press_event", this->updateSourceWindow, Window::windowOpen);
+  this->updateSourceWindow->connectSignal("destroy", this->updateSourceWindow, Window::windowClose);
+  this->updateSourceWindow->connectSignal("delete_event", this->updateSourceWindow, Window::windowClose);
+#endif /* HAVE_GTK2 */
+
+}
+
+/**
+   \returns A Pointer to the Button of the UpdaterSourceWindow
+*/
+Button* OrxonoxGuiUpdate::updateSourceWindowGetButton(void)
+{
+  return this->updateSourceWindowButton;
+}
+
+
+#ifdef HAVE_GTK2 
+/**
+   \brief updates the Data of orxonox.
+   \param w The widget, that executed this Function.
+   \param event The event that trigered this Function.
+   \param button The Button, that triggered this event.
+*/
+gint OrxonoxGuiUpdate::updateDataFunc(GtkWidget* w, GdkEventKey* event, void* info)
+{
+  FileInfo* dataInfo =(FileInfo*)info;
+
+  dataInfo->fileName = "02%20orxonox%203.mp3";
+  dataInfo->webRoot  = "http://www.orxonox.ethz.ch/files/";
+  dataInfo->localRoot = "./";
+  PRINTF(3)("Preparing to download file %s.\n", dataInfo->fileName);
+  downloadWithStyle(dataInfo);
+}
+
+/**
+   \brief updates the source of orxonox.
+   \param w The widget, that executed this Function.
+   \param event The event that trigered this Function.
+   \param button The Button, that triggered this event.
+*/
+gint OrxonoxGuiUpdate::updateSourceFunc(GtkWidget* w, GdkEventKey* event, void* bar)
+{
+  ProgressBar* tmpBar = static_cast<ProgressBar*>(bar);
+  tmpBar->setTotalSize(20);
+  tmpBar->setProgress(tmpBar->getProgress()+1);
+}
+#endif /* HAVE_GTK2 */
+
+/**
+   \brief The Function Curl calls to write out the File.
+   \param ptr A Pointer to the date to write.
+   \param size The size in bytes of one nmemb to write.
+   \param nmemb The Count of size to write.
+   \param stream Filehandler to write to.
+*/
+size_t OrxonoxGuiUpdate::curlWriteFunc(void* ptr, size_t size, size_t nmemb, FILE* stream)
+{
+  return fwrite(ptr, size, nmemb, stream);
+}
+
+/**
+   \brief The Function Curl calls to write out the File.
+   \param ptr A Pointer to the date to write to.
+   \param size The size in bytes of one nmemb to write.
+   \param nmemb The Count of size to write.
+   \param stream Filehandler to get data from.
+*/
+size_t OrxonoxGuiUpdate::curlReadFunc(void* ptr, size_t size, size_t nmemb, FILE* stream)
+{
+  return fread(ptr, size, nmemb, stream);
+}
+
+
+/**
+   \brief An update Function for the GUI, to show the progress.
+   \param Bar th ProgressBar to update
+   \param totalSize The total size of the download in bytes.
+   \param progress The current Progress of the download in bytes.
+   \param upTotal not needed
+   \param upProgress not needed
+*/
+int OrxonoxGuiUpdate::curlProgressFunc(ProgressBar* bar, double totalSize, double progress, double upTotal, double upProgress)
+{
+  bar->setProgress(progress);
+  bar->setTotalSize(totalSize);
+#ifdef HAVE_GTK2
+#ifndef HAVE_PTHREAD_H
+  while(gtk_events_pending()) gtk_main_iteration();
+#endif
+#endif
+  return 0;
+}
+
+/**
+   \brief The Curl handle for only one CURL(static).
+*/
+CURL* OrxonoxGuiUpdate::curlHandle = NULL;
+
+#ifdef HAVE_PTHREAD_H
+/** \brief The download Thread ID */
+pthread_t* OrxonoxGuiUpdate::downloadThreadID = new pthread_t;
+/**   \brief The download Thread ID*/
+pthread_t* OrxonoxGuiUpdate::downloadThreadFinishID = new pthread_t;
+#endif /* HAVE_PTHREAD_H */
+/**
+   \brief A bool parameter that shows if we are downloading.
+*/
+bool OrxonoxGuiUpdate::isDownloading = false;
+
+
+/**
+   \brief Initializes a Download without displaying it.
+   \param fileInfo the FileInfo.
+
+   !! BE AWARE THIS WILL NOT BE THREADED. !!
+*/
+bool OrxonoxGuiUpdate::download(void* fileInfo)
+{
+  if(isDownloading)
+    {
+      PRINTF(2)("unable to Download. already getting some file\n");
+      return false;
+    }
+  PRINTF(3)("Downloading.\n");
+  FileInfo* info =(FileInfo*)fileInfo;
+  CURLcode res;
+  CURL* localCurl;
+  localCurl = curl_easy_init();
+  char* fileOnNet = new char [strlen(info->webRoot)+strlen(info->fileName)+2];
+  strcpy(fileOnNet, info->webRoot);
+  if(fileOnNet[strlen(fileOnNet)] != '/') //!< \todo windows-shit
+    strcat(fileOnNet, "/");
+  strcat(fileOnNet, info->fileName);
+  char* fileOnDisk = new char [strlen(info->localRoot)+strlen(info->fileName)+2];
+  strcpy(fileOnDisk, info->localRoot);
+  if(fileOnDisk[strlen(fileOnDisk)] != '/') //!< \todo windows-shit
+    strcat(fileOnDisk, "/");
+  strcat(fileOnDisk, info->fileName);
+  
+  if(localCurl)
+    {
+      
+      info->fileHandle = fopen(fileOnDisk, "w");
+      
+      curl_easy_setopt(localCurl, CURLOPT_URL, fileOnNet);
+      curl_easy_setopt(localCurl, CURLOPT_WRITEDATA, info->fileHandle);
+      curl_easy_setopt(localCurl, CURLOPT_WRITEFUNCTION, curlWriteFunc);
+      curl_easy_setopt(localCurl, CURLOPT_READFUNCTION, curlReadFunc);
+      curl_easy_setopt(localCurl, CURLOPT_NOPROGRESS, true);
+      
+      curl_easy_perform(localCurl);
+
+      curl_easy_cleanup(localCurl);
+      fclose(info->fileHandle);
+    }
+}
+
+/**
+   \brief Initializes a Download with some style.
+   \param fileInfo the FileInfo.
+   \todo release thread-lock.
+
+   Downloading with a Button that gets a different Name while downloading, and a Bar, that gets to be updated. More to be followed
+*/
+bool OrxonoxGuiUpdate::downloadWithStyle(void* fileInfo)
+{
+  if(isDownloading)
+    {
+      PRINTF(2)("unable to Download. already getting some file\n");
+      return false;
+    }
+  PRINTF(3)("Downloading.\n");
+  FileInfo* info =(FileInfo*)fileInfo;
+  CURLcode res;
+  curlHandle = curl_easy_init();
+  char* fileOnNet = new char [strlen(info->webRoot)+strlen(info->fileName)+1];
+  strcpy(fileOnNet, info->webRoot);
+  strcat(fileOnNet, info->fileName);
+  char* fileOnDisk = new char [strlen(info->localRoot)+strlen(info->fileName)+1];
+  strcpy(fileOnDisk, info->localRoot);
+  strcat(fileOnDisk, info->fileName);
+
+  if(curlHandle)
+    {
+      
+      info->fileHandle = fopen(fileOnDisk, "w");
+      
+      curl_easy_setopt(curlHandle, CURLOPT_URL, fileOnNet);
+      curl_easy_setopt(curlHandle, CURLOPT_WRITEDATA, info->fileHandle);
+      curl_easy_setopt(curlHandle, CURLOPT_WRITEFUNCTION, curlWriteFunc);
+      curl_easy_setopt(curlHandle, CURLOPT_READFUNCTION, curlReadFunc);
+      curl_easy_setopt(curlHandle, CURLOPT_NOPROGRESS, false);
+      curl_easy_setopt(curlHandle, CURLOPT_PROGRESSFUNCTION, curlProgressFunc);
+      curl_easy_setopt(curlHandle, CURLOPT_PROGRESSDATA, info->bar);
+
+      if(!isDownloading)
+	{
+#ifdef HAVE_PTHREAD_H	  
+	  pthread_join(*downloadThreadFinishID, NULL);
+#endif /* HAVE_PTHREAD_H */
+#ifdef HAVE_GTK2 
+	  info->stateButton->disconnectSignal(info->buttonSignal);
+	  info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, cancelDownload);
+#endif /* HAVE_GTK2 */
+#ifdef HAVE_PTHREAD_H
+	  info->stateButton->setTitle("cancel");
+#else /* HAVE_PTHREAD_H */
+	  info->stateButton->setTitle("please wait");
+#endif /* HAVE_PTHREAD_H */
+	  
+	  //! \todo check if threads really were created.
+#ifdef HAVE_PTHREAD_H
+	  pthread_create(downloadThreadID, NULL, downloadThread, info);
+	  pthread_create(downloadThreadFinishID, NULL, downloadThreadFinished, info);  
+#else
+	  downloadThread(info);
+	  downloadThreadFinished(info);
+#endif /* HAVE_PTHREAD_H */
+	 
+	  //      res = curl_easy_perform(curlHandle);
+	  
+	  //      fclose(outfile);
+	}
+      else 
+	PRINTF(1)("thread already in use\n");
+
+    }
+  return true;
+}
+
+/**
+   \brief The downloading process(either threaded or not).
+   \param fileInfo the FileInfo.
+
+   \todo Threads get locked, if the cancel button is pressed in to small intervals.
+*/
+void* OrxonoxGuiUpdate::downloadThread(void* fileInfo)
+{
+  isDownloading = true;
+  curl_easy_perform(curlHandle);
+}
+
+/**
+   \brief Finishes a downloading process. 
+   \param fileInfo the FileInfo.
+*/
+void* OrxonoxGuiUpdate::downloadThreadFinished(void* fileInfo)
+{ 
+  FileInfo* info =(FileInfo*)fileInfo;
+#ifdef HAVE_PTHREAD_H
+  pthread_join(*downloadThreadID, NULL);
+#ifdef HAVE_GTK2 
+  gdk_threads_enter();
+#endif /* HAVE_GTK2 */
+#endif /* HAVE_PTHREAD_H */
+  if(curlHandle)
+    curl_easy_cleanup(curlHandle);
+ 
+  PRINTF(3)("Closing the downloaded file.\n");
+  fclose(info->fileHandle);
+
+  if(isDownloading)
+    info->stateButton->setTitle("go on");
+  //  else
+  //    info->stateButton->setTitle("done");
+#ifdef HAVE_GTK2 
+  info->stateButton->disconnectSignal(info->buttonSignal);
+  info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, updateDataFunc);
+#endif /* HAVE_GTK2 */
+  isDownloading = false;
+#ifdef HAVE_PTHREAD_H
+#ifdef HAVE_GTK2 
+  gdk_threads_leave();
+#endif /* HAVE_GTK2 */
+#endif /* HAVE_PTHREAD_H */
+
+}
+
+#ifdef HAVE_GTK2
+/**
+   \brief canceles a downloading session.
+   \param w The widget, that executed this Function.
+   \param event The event that trigered this Function.
+   \param bar The Bar, that triggered this event.
+
+   \todo canceling a session in non-threaded mode.
+*/
+gint OrxonoxGuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar)
+{
+#ifdef HAVE_PTHREAD_H
+  pthread_cancel(*downloadThreadID);
+#else
+  PRINTF(2)("Cannot cancle the Downloading process until after this File, because no threading was enabled");
+#endif /* HAVE_PTHREAD_H*/
+}
+#endif /* HAVE_GTK2 */
+
+#endif /* HAVE_CURL */
Index: orxonox/trunk/src/gui/orxonox_gui_update.h
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_update.h	(revision 3423)
+++ orxonox/trunk/src/gui/orxonox_gui_update.h	(revision 3423)
@@ -0,0 +1,113 @@
+/*!
+  \file orxonox_gui_update.h
+  \brief File that holds the class that creates the update-menu.
+*/
+
+#ifndef _ORXONOX_GUI_UPDATE_H
+#define _ORXONOX_GUI_UPDATE_H
+
+#include "orxonox_gui.h"
+#include <stdio.h>
+#ifdef HAVE_CURL
+#include <curl/curl.h>
+#include <curl/types.h>
+#include <curl/easy.h>
+#endif /* HAVE_CURL */
+#ifdef HAVE_PTHREAD_H
+#define _MULTI_THREADED
+#include <pthread.h>
+#endif /* HAVE_PTHREAD_H */
+using namespace std;
+
+//! Class that creates the execute-Options.
+class OrxonoxGuiUpdate
+{
+ private:
+  // Defining Variables
+  char* tmpDir;                         //!< The Temporary directory.
+  char* homeDir;                        //!< The Home directory.
+  char* installDataDir;                 //!< Where to install the Data to.
+  char* installSourceDir;               //!< Where to install the Source to.
+  char* userName;                       //!< The user logged in.
+
+  bool getSystemInfo(void);
+ 
+  // Window creation.
+  Frame* updateFrame;                   //!< The Frame that holds the updateOptions.
+  Box* updateBox;                       //!< The Box that holds the updateOptions.
+  CheckButton* autoUpdate;              //!< A Checkbutton to enable the automatic Updating.
+
+  
+  Button* updateDataWindowButton;       //!< A Button to update the Data of orxonox.
+  Window* updateDataWindow;             //!< A Window for the data-update.
+  Box* updateDataBox;                   //!< A Box for the Window for the Data-update.
+  ProgressBar* updateDataBar;           //!< A Bar to display the progress of the download.
+  Button* updateDataBegin;              //!< A Button to start the process.
+
+  Button* updateSourceWindowButton;     //!< A Button to update the Source of orxonox. \todo tricky
+  Window* updateSourceWindow;           //!< A Window for the Source-update.
+  Box* updateSourceBox;                 //!< A Box for the Window for the Source-update.
+  ProgressBar* updateSourceBar;         //!< A Bar to display the progress of the download.
+
+  Button* test;                         //!< will be deleted soon.
+
+#ifdef HAVE_GTK2
+  static gint updateDataFunc(GtkWidget* w, GdkEventKey* event, void* info);
+  static gint updateSourceFunc(GtkWidget* w, GdkEventKey* event, void* info);
+#endif /* HAVE_GTK2 */
+
+#ifdef HAVE_CURL
+  //! A Struct to hold information about one File to download.
+  struct FileInfo
+  {
+    char* fileName;                     //!< The Name of the file we want to get.
+    char* webRoot;                      //!< The Root of the File on The Web
+    char* localRoot;                    //!< The Root directory to put the files on the local disk.
+    FILE* fileHandle;                   //!< A fileHandler.
+
+    Button* stateButton;                //!< A button that shows either start or cancel;
+    long int buttonSignal;              //!< The Signal of the stateButton.
+    ProgressBar* bar;                   //!< The ProgressBar, that sould be updated.
+  };
+
+  static size_t curlWriteFunc(void* ptr, size_t size, size_t nmemb, FILE* stream);
+  static size_t curlReadFunc(void* ptr, size_t size, size_t nmemb, FILE* stream);
+  static int curlProgressFunc(ProgressBar* bar, double totalSize, double progress, double upTotal, double upProgress);
+
+  static CURL* curlHandle;
+#ifdef HAVE_GTK2 
+  static gint cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar);
+#endif /* HAVE_GTK2 */  
+#ifdef HAVE_PTHREAD_H
+  static pthread_t* downloadThreadID;
+  static pthread_t* downloadThreadFinishID;
+#endif /* HAVE_PTHREAD_H */
+  static bool isDownloading;
+
+  static bool download(void* fileInfo);
+  static bool downloadWithStyle(void* fileInfo);
+  static void* downloadThread(void* fileInfo);
+  static void* downloadThreadFinished(void* fileInfo);
+
+  
+#endif /* HAVE_CURL */
+
+ public:
+  OrxonoxGuiUpdate(void);
+  ~OrxonoxGuiUpdate(void);
+  
+  Widget* getWidget(void);
+#ifdef HAVE_CURL   
+  void updateDataWindowCreate(void);
+  Button* updateDataWindowGetButton(void);
+
+  void updateSourceWindowCreate(void);
+  Button* updateSourceWindowGetButton(void);
+
+  bool* checkForUpdates(void);
+ 
+#endif /* HAVE_CURL */
+
+};
+
+#endif /* _ORXONOX_GUI_UPDATE_H */
Index: orxonox/trunk/src/gui/orxonox_gui_video.cc
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_video.cc	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_video.cc	(revision 3423)
@@ -30,20 +30,31 @@
    \brief Creates the Video-Option-Frame
 */
-OrxonoxGuiVideo::OrxonoxGuiVideo ()
+OrxonoxGuiVideo::OrxonoxGuiVideo(void)
 {
-  videoFrame = new Frame ("Video-Options:");
-  videoBox = new Box ('v');
-  videoFrame->setGroupName("video");
+  this->videoFrame = new Frame("Video-Options:");
+  this->videoBox = new Box('v');
+  this->videoFrame->setGroupName("video");
   
-  fullscreen = new CheckButton ("Fullscreen-mode");
-  fullscreen->setFlagName ("windowed", "q", 1);
-  fullscreen->saveable = true;
-  videoBox->fill (fullscreen);
-  wireframe = new CheckButton ("WireFrame-mode");
-  wireframe->setFlagName ("wireframe", "w", 0);
-  wireframe->saveable = true;
-  videoBox->fill (wireframe);
+  this->fullscreen = new CheckButton("Fullscreen-mode");
+  this->fullscreen->setFlagName("windowed", "q", 1);
+  this->fullscreen->saveability();
+  this->videoBox->fill(fullscreen);
+  this->wireframe = new CheckButton("WireFrame-mode");
+  this->wireframe->setFlagName("wireframe", "w", 0);
+  this->wireframe->saveability();
+  this->videoBox->fill(wireframe);
 
-  videoFrame->fill (videoBox);
+  this->advancedWindowCreate();
+  this->videoBox->fill(this->advancedWindowGetButton());
+
+  this->videoFrame->fill(videoBox);
+}
+
+/**
+   \brief Destructs the Video-stuff
+*/
+OrxonoxGuiVideo::~OrxonoxGuiVideo(void)
+{
+  // nothing to do here.
 }
 
@@ -51,6 +62,83 @@
    \return Returns the Video-frame
 */
-Widget* OrxonoxGuiVideo::getWidget ()
+Widget* OrxonoxGuiVideo::getWidget(void)
 {
-  return videoFrame;
+  return this->videoFrame;
 }
+
+
+/**
+   \brief Creates a window, and all it contains for the Source-update.
+*/
+void OrxonoxGuiVideo::advancedWindowCreate(void)
+{
+  // the button, that opens this Window.
+  this->advancedButton = new Button("advanced");
+
+  // the Window itself
+  this->advancedWindow = new Window("Advanced Video Options");
+  this->advancedWindow->setGroupName("advancedVideoOptions");
+
+  this->advancedBox = new Box('v');
+
+  // Advanced Performance Options
+  this->shadows = new CheckButton("Shadows");
+  this->shadows->saveability();
+  this->advancedBox->fill(this->shadows);
+
+  this->fog = new CheckButton("Fog");
+  this->fog->saveability();
+  this->advancedBox->fill(this->fog);
+
+  this->reflections = new CheckButton("Reflections");
+  this->reflections->saveability();
+  this->advancedBox->fill(this->reflections);
+
+  this->textures = new CheckButton("Textures");
+  this->textures->saveability();
+  this->advancedBox->fill(this->textures);
+
+  this->textureDetail = new Menu("Texture Detail", "low", "medium", "high", "lastItem");
+  this->textureDetail->saveability();
+  this->advancedBox->fill(this->textureDetail);
+
+  this->modelDetailLabel = new Label("Model Detail");
+  this->advancedBox->fill(this->modelDetailLabel);
+  this->modelDetail = new Menu("Model Detail", "low", "medium", "high", "lastItem");
+  this->modelDetail->saveability();
+  this->advancedBox->fill(this->modelDetail);
+
+  this->antiAliasingLabel = new Label("Anti-Aliasing-depth:");
+  this->advancedBox->fill(this->antiAliasingLabel);
+  this->antiAliasing = new Menu("Anti Aliasing", "0", "1", "2", "4", "8",  "lastItem");
+  this->antiAliasing->saveability();
+  this->advancedBox->fill(this->antiAliasing);
+
+  this->filterMethodLabel = new Label("Filtering Method:");
+  this->advancedBox->fill(this->filterMethodLabel);
+  this->filterMethod = new Menu("Filtering Method", "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem");
+  this->filterMethod->saveability();
+  this->advancedBox->fill(this->filterMethod);
+  
+  this->closeButton = new Button("close");
+  this->advancedBox->fill(this->closeButton);
+
+  this->advancedWindow->fill(advancedBox);
+#ifdef HAVE_GTK2 
+  this->advancedButton->connectSignal("button_press_event", this->advancedWindow, Window::windowOpen);
+  this->closeButton->connectSignal("button_press_event", this->advancedWindow, Window::windowClose);
+  this->advancedWindow->connectSignal("destroy", this->advancedWindow, Window::windowClose);
+  this->advancedWindow->connectSignal("delete_event", this->advancedWindow, Window::windowClose);
+#endif /* HAVE_GTK2 */
+   Window::addWindow(this->advancedWindow);
+
+}
+
+/**
+   \returns A Pointer to the Button of the UpdaterSourceWindow
+*/
+Button* OrxonoxGuiVideo::advancedWindowGetButton(void)
+{
+  return this->advancedButton;
+}
+
Index: orxonox/trunk/src/gui/orxonox_gui_video.h
===================================================================
--- orxonox/trunk/src/gui/orxonox_gui_video.h	(revision 3422)
+++ orxonox/trunk/src/gui/orxonox_gui_video.h	(revision 3423)
@@ -16,9 +16,34 @@
   CheckButton* fullscreen;  //!< CheckButton for fullscreen-mode
   CheckButton* wireframe;   //!< CheckButton for wireframe Mode.
+
+  // advanced-Performance-Options
+  Window* advancedWindow;   //!< A Window to display advanced options.
+  Button* advancedButton;   //!< A Button to open the Advanced Video Performance Window.
+  Box* advancedBox;         //!< A Box to pack the options into.
+  CheckButton* shadows;     //!< CheckButton for shadows
+  CheckButton* fog;         //!< CheckButton for fog.
+  CheckButton* reflections; //!< CheckButton for reflections
+  CheckButton* textures;    //!< CheckButton for textures
+  Menu* textureDetail;      //!< Menu for the Texture-Detail.
+  
+  Label* modelDetailLabel;  //!< Label for model-detail.
+  Menu* modelDetail;        //!< model-detail.
+  
+  Label* antiAliasingLabel; //!< Label for the anti-aliasing mode.
+  Menu* antiAliasing;       //!< Menu for the Antialiasing-mode.
+
+  Label* filterMethodLabel; //!< Label for filtering-Method.
+  Menu* filterMethod;       //!< Menu for filtering Method.
+
+  Button* closeButton;      //!< A Button to close the Advanced-settingsWindow.
+
+  Button* advancedWindowGetButton(void);
+  void advancedWindowCreate(void);
+  
  public:
-  OrxonoxGuiVideo ();
-  ~OrxonoxGuiVideo ();
+  OrxonoxGuiVideo(void);
+  ~OrxonoxGuiVideo(void);
   
-  Widget* getWidget ();
+  Widget* getWidget(void);
 };
 #endif /* _ORXONOX_GUI_VIDEO_H */
Index: orxonox/trunk/src/gui/rc
===================================================================
--- orxonox/trunk/src/gui/rc	(revision 3422)
+++ orxonox/trunk/src/gui/rc	(revision 3423)
@@ -120,17 +120,17 @@
 # just listed in this document for the users reference.
 
-widget_class "GtkWindow" style "window"
-widget_class "GtkFrame" style "window"
-widget_class "Gtk*EventBox" style "window"
-widget_class "GtkDialog" style "window"
-widget_class "GtkFileSelection" style "window"
-widget_class "*Gtk*Scale" style "scale"
-widget_class "*GtkCheckButton*" style "toggle_button"
-widget_class "*Gtk*Menu*" style "toggle_button"
-widget_class "*GtkRadioButton*" style "toggle_button"
-widget_class "*GtkButton*" style "button"
-widget_class "*Ruler" style "ruler"
-widget_class "*GtkText" style "text"
-widget_class "*GtkLabel" style "text"
+widget_class "GtkWindow"           style "window"
+widget_class "GtkFrame"            style "window"
+widget_class "Gtk*EventBox"        style "window"
+widget_class "GtkDialog"           style "window"
+widget_class "GtkFileSelection"    style "window"
+widget_class "*Gtk*Scale"          style "scale"
+widget_class "*GtkCheckButton*"    style "toggle_button"
+widget_class "*Gtk*Menu*"          style "toggle_button"
+widget_class "*GtkRadioButton*"    style "toggle_button"
+widget_class "*GtkButton*"         style "button"
+widget_class "*Ruler"              style "ruler"
+widget_class "*GtkText"            style "text"
+widget_class "*GtkLabel"           style "text"
 
 
Index: orxonox/trunk/src/importer/Makefile.in
===================================================================
--- orxonox/trunk/src/importer/Makefile.in	(revision 3422)
+++ orxonox/trunk/src/importer/Makefile.in	(revision 3423)
@@ -89,4 +89,6 @@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CFLAGS = @CURL_CFLAGS@
+CURL_LIBS = @CURL_LIBS@
 CXX = @CXX@
 CXXDEPMODE = @CXXDEPMODE@
@@ -104,6 +106,12 @@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
+GTHREAD_LIBS = @GTHREAD_LIBS@
 GTK2_CFLAGS = @GTK2_CFLAGS@
 GTK2_LIBS = @GTK2_LIBS@
+HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
+HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
+HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
+HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
 HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
 HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
@@ -207,7 +215,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/importer/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/importer/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  src/importer/Makefile
+	  $(AUTOMAKE) --gnu  src/importer/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
