Index: /orxonox/trunk/gui/Makefile.am
===================================================================
--- /orxonox/trunk/gui/Makefile.am	(revision 3143)
+++ /orxonox/trunk/gui/Makefile.am	(revision 3144)
@@ -4,9 +4,23 @@
 
 bin_PROGRAMS=gui
-gui_SOURCES=orxonox_gui.cc orxonox_gui_video.cc	orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_flags.cc orxonox_gui_banner.cc orxonox_gui_keys.cc
+gui_SOURCES=orxonox_gui.cc \
+	    orxonox_gui_gtk.cc \
+	    orxonox_gui_video.cc \
+	    orxonox_gui_audio.cc \
+	    orxonox_gui_exec.cc \
+	    orxonox_gui_flags.cc \
+	    orxonox_gui_banner.cc \
+	    orxonox_gui_keys.cc
 
-noinst_HEADERS=orxonox_gui.h orxonox_gui_video.h orxonox_gui_audio.h orxonox_gui_exec.h orxonox_gui_flags.h orxonox_gui_banner.h orxonox_gui_keys.h
+noinst_HEADERS=orxonox_gui.h \
+	    orxonox_gui_gtk.h \
+	    orxonox_gui_video.h \
+	    orxonox_gui_audio.h \
+	    orxonox_gui_exec.h \
+	    orxonox_gui_flags.h \
+	    orxonox_gui_banner.h \
+	    orxonox_gui_keys.h
 
-#  uncomment the following if orxonox requires the math library
+#  uncomment the following if orxonox requires the mathlibrary
 #gui_LDADD=-lm
 
Index: /orxonox/trunk/gui/Makefile.in
===================================================================
--- /orxonox/trunk/gui/Makefile.in	(revision 3143)
+++ /orxonox/trunk/gui/Makefile.in	(revision 3144)
@@ -53,8 +53,8 @@
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
-am_gui_OBJECTS = orxonox_gui.$(OBJEXT) orxonox_gui_video.$(OBJEXT) \
-	orxonox_gui_audio.$(OBJEXT) orxonox_gui_exec.$(OBJEXT) \
-	orxonox_gui_flags.$(OBJEXT) orxonox_gui_banner.$(OBJEXT) \
-	orxonox_gui_keys.$(OBJEXT)
+am_gui_OBJECTS = orxonox_gui.$(OBJEXT) orxonox_gui_gtk.$(OBJEXT) \
+	orxonox_gui_video.$(OBJEXT) orxonox_gui_audio.$(OBJEXT) \
+	orxonox_gui_exec.$(OBJEXT) orxonox_gui_flags.$(OBJEXT) \
+	orxonox_gui_banner.$(OBJEXT) orxonox_gui_keys.$(OBJEXT)
 gui_OBJECTS = $(am_gui_OBJECTS)
 gui_LDADD = $(LDADD)
@@ -67,4 +67,5 @@
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_exec.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_flags.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_gtk.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_keys.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox_gui_video.Po
@@ -174,8 +175,24 @@
 target_vendor = @target_vendor@
 AM_CXXFLAGS = $(GTK2_CFLAGS) $(MSBITFIELDS)
-gui_SOURCES = orxonox_gui.cc orxonox_gui_video.cc	orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_flags.cc orxonox_gui_banner.cc orxonox_gui_keys.cc
-noinst_HEADERS = orxonox_gui.h orxonox_gui_video.h orxonox_gui_audio.h orxonox_gui_exec.h orxonox_gui_flags.h orxonox_gui_banner.h orxonox_gui_keys.h
-
-#  uncomment the following if orxonox requires the math library
+gui_SOURCES = orxonox_gui.cc \
+	    orxonox_gui_gtk.cc \
+	    orxonox_gui_video.cc \
+	    orxonox_gui_audio.cc \
+	    orxonox_gui_exec.cc \
+	    orxonox_gui_flags.cc \
+	    orxonox_gui_banner.cc \
+	    orxonox_gui_keys.cc
+
+noinst_HEADERS = orxonox_gui.h \
+	    orxonox_gui_gtk.h \
+	    orxonox_gui_video.h \
+	    orxonox_gui_audio.h \
+	    orxonox_gui_exec.h \
+	    orxonox_gui_flags.h \
+	    orxonox_gui_banner.h \
+	    orxonox_gui_keys.h
+
+
+#  uncomment the following if orxonox requires the mathlibrary
 #gui_LDADD=-lm
 
@@ -257,4 +274,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_exec.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_flags.Po@am__quote@
+@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_video.Po@am__quote@
Index: /orxonox/trunk/gui/orxonox_gui.cc
===================================================================
--- /orxonox/trunk/gui/orxonox_gui.cc	(revision 3143)
+++ /orxonox/trunk/gui/orxonox_gui.cc	(revision 3144)
@@ -104,805 +104,2 @@
 }
 
-/* WIDGET */
-
-/**
-   \brief deletes any given Widget
-   This is still pretty crappy.
-*/
-Widget::~Widget()
-{
-  //  cout << "hiding: " <<this->label <<"\n";
-  this->hide();
-  //  cout << "check if Packer: "<<this->label <<"\n";
-  if (this->is_option < 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;
-}
-
-/**
-   \brief Initializes a widget.
-   Initializes the next Pointer and the other Widget-specific Defaults.
-*/
-void Widget::init()
-{
-  next = NULL;
-  label = "";
-  return;
-}
-
-/**
-   \brief makes the widget visible.
-*/
-void Widget::show()
-{
-  gtk_widget_show (this->widget);
-}
-
-/**
-   \brief hides the widget.
-*/
-void Widget::hide()
-{
-  gtk_widget_hide (this->widget);
-}
-
-/**
-   \brief Sets the resolution of a specific widget to the given size.
-   \param width the width of the widget to set.
-   \param height the height of the widget to set.
-*/
-void Widget::setSize(int width, int height)
-{
-  gtk_widget_set_usize (this->widget, width, height);
-}
-
-/** 
-    \brief Connect any signal to any given Sub-widget
-*/
-void Widget::connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *))
-{
-  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL);
-}
-
-/**
-   \brief Connect a signal with additionally passing the whole Object
-*/
-void Widget::connectSignal (char* event, gint (*signal)( GtkWidget*, Widget *))
-{
-g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), this);
-}
-
-/**
-   \brief Connect a signal with additionally passing a whole external Object
-*/
-void Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *))
-{
-  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
-}
-
-/**
-   \brief Connect a signal with additionally passing a whole external Object
-*/
-void Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *))
-{
-  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
-}
-
-/**
-   \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*))
-{
-  function(this);
-  if (this->is_option < 0)
-    {
-      static_cast<Packer*>(this)->down->walkThrough (function);
-    } 
-
-  if (this->next != NULL)
-    this->next->walkThrough(function);
-}
-
-/** 
-    \brief This is for listing the option of "widget"
-    \param widget specifies the widget that should be listed
-*/
-void Widget::listOptions (Widget* widget)
-{
-  if (widget->is_option >= 1)
-    cout << static_cast<Option*>(widget)->label <<" is : " << static_cast<Option*>(widget)->value <<endl;
-}
-
-/** 
-    \brief This is for setting the option of "widget"
-    \param widget specifies the widget that should be set.
-*/
-void Widget::setOptions (Widget* widget)
-{
-  if (widget->is_option >= 1)
-    static_cast<Option*>(widget)->redraw();// <<" is : " << static_cast<Option*>(this)->value <<endl;
-}
-
-//void deleteWidget(Widget* lastWidget)
-
-
-/* PACKERS */
-
-/**
-   \brief Initializes a Packer.
-   Sets the down-pinter to NULL and other PackerSpecific-values to their defaults.
-*/
-void Packer::init (void)
-{
-  down = NULL;
-  this->setGroupName ("");
-
-
-  static_cast<Widget*>(this)->init();
-  return;
-}
-
-/**
-   \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)
-{
-  groupName = name;
-}
-
-/**
-   \brief Retrieves the group name under which all the lower widgets of this will be saved.
-   \returns name The name of the group.
-*/
-char* Packer::getGroupName (void)
-{
-  return groupName;
-}
-
-/* CONTAINERS */
-
-/**
-   \brief Initializes a Container.
-   sets the Container-Specific defaults.
-*/
-void Container::init (void)
-{
-  is_option = -1;
-
-  static_cast<Packer*>(this)->init();
-
-  return;
-}
-
-/**
-   \briefFills a Container with lowerWidget.
-   It does this by filling up the down pointer only if down points to NULL.
-   \param lowerWidget the Widget that should be filled into the Container.
-*/
-void Container::fill (Widget *lowerWidget)
-{
-  if (this->down == NULL)
-    {
-      gtk_container_add (GTK_CONTAINER (this->widget), lowerWidget->widget);
-      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"<<endl;
-}
-
-// gtk_container_set_border_width (GTK_CONTAINER (widget), 5);
-
-/* WINDOW */
-
-/**
-   \brief Creating a new Window without a Name
-*/
-Window::Window (void)
-{
-  this->init();
-}
-
-/**
-   \brief Creating a Window with a name
-   \param windowName the name the window should get.
-*/
-Window::Window (char* windowName)
-{
-  this->init();
-  this->setTitle (windowName);
-}
-
-Window* Window::lastWindow = NULL;
-
-/**
-   \brief initializes a new Window
-*/
-void Window::init()
-{
-  isOpen = false;
-
-  static_cast<Container*>(this)->init();
-
-  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);
-#endif 
-  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
-
-  //  printf("%p\n",lastWindow);
-
-  if (lastWindow !=NULL)
-    {
-      lastWindow->next = this;
-      printf("%p, %p\n", lastWindow, this);
-    }
-  Window::lastWindow = this;
-}
-
-/**
-   \brief Shows all Widgets that are included within this->widget.
-*/
-void Window::showall ()
-{
-  if (!isOpen)
-    {
-      printf ("showall\n");
-      gtk_widget_show_all  (widget);
-      isOpen = true;
-    }
-  else
-    {
-      printf ("showone\n");
-      gtk_widget_show (widget);
-    }
-}
-
-/**
-   \brief Set The Window-title to title
-   \param title title the Window should get.
-*/
-void Window::setTitle (char* title)
-{
-  label=title;
-  gtk_window_set_title (GTK_WINDOW (widget), title);
-}
-
-/**
- * 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 (orxonoxGUI);
-
-  gtk_main_quit();
-  return FALSE;
-}
-
-
-/* FRAME */
-
-/** 
-    \brief Creates a new Frame without a name
-*/
-Frame::Frame (void)
-{
-  this->init();
-}
-
-/**
-   \brief Creates a new Frame with name title
-*/
-Frame::Frame (char* title)
-{
-  this->init();
-  this->setTitle(title);
-}
-
-/** 
-    \brief Initializes a new Frame with default settings
-*/
-void Frame::init()
-{
-  static_cast<Container*>(this)->init();
-  
-  widget = gtk_frame_new ("");
-  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
-}
-
-/**
-   \brief Sets the Frames name to title
-   \param title The title the Frame should get.
-*/
-void Frame::setTitle (char* title)
-{
-  label = title;
-  gtk_frame_set_label (GTK_FRAME (widget), title);
-}
-
-// EVENTBOX //
-
-/**
-   \brief Creates a new EventBox with default settings.
-*/
-EventBox::EventBox ()
-{
-  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)
-{
-  this->init();
-  this->setTitle(title);
-
-}
-
-/**
-   \brief Initializes a new EventBox
-*/
-void EventBox::init(void)
-{
-  is_option = -1;
-
-  static_cast<Container*>(this)->init();
-
-  widget = gtk_event_box_new ();
-  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
- 
-}
-
-/**
-   \brief Sets the Title of the EventBox (not implemented)
-   \param title Name the EventBox should get (only datastructure-internal).
-*/
-void EventBox::setTitle (char* title)
-{
-  label = title;
-}
-
-/* BOX */
-
-/**
-   \brief Creates a new horizontal Box
-*/
-Box::Box (void)
-{
-  this->init('h');
-}
-
-/**
-   \brief Creates a new Box of type boxtype
-   \param boxtype if 'v' the Box will be vertically, if 'h' the Box will be horizontally
-*/
-Box::Box (char boxtype)
-{
-  this->init(boxtype);
-}
-
-/**
-   \brief Initializes a new Box with type boxtype
-   \param boxtype see Box(char boxtype)
-*/
-void Box::init(char boxtype)
-{
-  is_option = -2;
-
-  static_cast<Packer*>(this)->init();
-  if (boxtype == 'v')
-    {
-      widget = gtk_vbox_new (FALSE, 0);
-    }
-  else
-    {
-      widget = gtk_hbox_new (FALSE, 0);
-    }
-}
-
-/** 
-    \brief Fills a box with a given Widget.
-    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
-    \param lowerWidget the next Widget that should be appendet to this Box
-*/
-void Box::fill (Widget *lowerWidget)
-{
-  gtk_box_pack_start (GTK_BOX (this->widget), lowerWidget->widget, TRUE, TRUE, 0);
-  if (this->down == NULL)
-    this->down = lowerWidget;
-  else
-    {
-      Widget* tmp;
-      tmp = this->down;
-      while (tmp->next != NULL)
-	{
-	  tmp = tmp->next;
-	}
-      tmp->next = lowerWidget;
-    }
-}
-
-/* IMAGE */
-
-/**
-   \brief Creates a new Image
-   \param imagename the location of the Image on the Hard Disc
-*/
-Image::Image (char* imagename)
-{
-  this->init();
-  widget = gtk_image_new_from_file (imagename);
-  label = imagename;
-}
-
-/** 
-    \brief Initializes a new Image
-*/
-void Image::init()
-{
-  is_option = 0;
-
-  static_cast<Widget*>(this)->init();
-}
-
-
-/* OPTION */
-
-/**
-   \brief Initializes a new Option.
-   sets all Option-Specific-Values to their defaults.
-*/
-void Option::init()
-{
-  value = 0;
-  flag_name = "";
-  flag_name_short = "";
-  saveable = false;
-  default_value = 0;
-
-  static_cast<Widget*>(this)->init();
-
-  return;
-}
-
-/**
-   \brief This sets The FlagName of an Option and defines its default Values
-   !! Options will be saved if flagname is different from "" !!
-   \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)
-{
-  flag_name = flagname;
-  default_value = defaultvalue;
-  cout << "Set Flagname of " << label << " to " << flagname << endl;
-}
-
-/** 
-    \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 flagnameshort a short flagname to be displayed in the output
-*/
-void Option::setFlagName (char* flagname, char* flagnameshort,  int defaultvalue)
-{
-  flag_name = flagname;
-  flag_name_short = flagnameshort;
-  default_value = defaultvalue;
-  cout << "Set Flagname of " << label << " to " << flagname << endl;
-}
-
-
-/* BUTTON */
-
-/**
-   \brief Creates a new Button with a buttonname
-   \param buttonname sets the Name of the Button
-*/
-Button::Button(char* buttonname)
-{
-  this->init();
-  this->setTitle(buttonname);
-}
-
-/**
-   \brief Initializes a new Button
-*/
-void Button::init(void)
-{
-  is_option = 0;
-
-  static_cast<Option*>(this)->init();
-
-  widget = gtk_button_new_with_label ("");
-}
-
-/**
-   \brief Sets a new name to the Button
-   \param title The name the Button should get
-*/
-void Button::setTitle (char *title)
-{
-  label = title;
-  gtk_button_set_label (GTK_BUTTON(widget), title);
-}
-
-/**
-   \brief redraws the Button
-   not implemented yet
-*/
-void Button::redraw ()
-{
-}
-
-/* CHECKBUTTON */
-
-/**
-   \brief Creates a new CheckButton with an ame 
-   \param buttonname The name the CheckButton should display.
-*/
-CheckButton::CheckButton (char* buttonname)
-{
-  this->init();
-  this->setTitle(buttonname);
-
-  this->connectSignal ("clicked", this->OptionChange);
-}
-
-/**
-   \brief Initialize a new CheckButton with default settings
-*/
-void CheckButton::init(void)
-{
-  is_option = 1;
-
-  static_cast<Option*>(this)->init();
-
-  widget = gtk_check_button_new_with_label ("");
-}
-
-/**
-   \brief Sets a new Title to a CheckButton
-   \param title The new Name the CheckButton should display.
-*/
-void CheckButton::setTitle(char* title)
-{
-  label = title;
-  gtk_button_set_label(GTK_BUTTON(widget), title);
-}
-
-
-/** 
-    \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);
-  cout << static_cast<CheckButton*>(checkbutton)->label << " set to: " << static_cast<CheckButton*>(checkbutton)->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 ()
-{
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), value);
-}
-
-/* SLIDER */
-
-/**
-   \brief Creates a new Slider
-   \param slidername The data-structure-name of the slider.
-   \param start The minimal Value of the slider.
-   \param end The maximal Value of the slider.
-*/
-Slider::Slider (char* slidername, int start, int end)
-{
-  this->init(start, end);
-  this->setValue(start);
-  this->setTitle(slidername);
-  this->connectSignal ("value_changed", this->OptionChange);
-}
-
-/**
-   \brief Initializes a Slider with start and end Values
-   params: see Slider::Slider (char* slidername, int start, int end)
-*/
-void Slider::init(int start, int end)
-{
-  is_option = 2;
-
-  static_cast<Option*>(this)->init();
-
-  widget = gtk_hscale_new_with_range (start, end, 5);
-}
-
-/**
-   \brief Sets a new Title to the Slider
-   \param title The new Name of the slider
-*/
-void Slider::setTitle(char* title)
-{
-  label = title;
-}
-
-/**
-   \brief Setting a new value to the Slider.
-   Maybe you also require a Slider::redraw() for this to display
-*/
-void Slider::setValue(int value)
-{
-  this->value = value;
-}
-
-/** 
-    \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);
-  cout << static_cast<Slider*>(slider)->label << " set to: "<< static_cast<Slider*>(slider)->value << endl;
-}
-
-/**
-   \brief Redraws the widget
-   Example: see void CheckButton::redraw ()
-*/
-void Slider::redraw ()
-{
-  gtk_range_set_value (GTK_RANGE (widget), value);
-}
-
-/* MENU */
-
-/** 
-    \brief Creates a Menu-Item-list out of multiple input.
-    !! Consider, that the last input argument has to be "lastItem" for this to work!!
-    \param menuname The Database-Name of this Menu
-    \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, ...)
-{
-  this->init();
-  this->setTitle(menuname);
-    
-  char *itemName;
-  
-  va_start (itemlist, menuname);
-  while (strcmp (itemName = va_arg (itemlist, char*), "lastItem"))
-    {
-      this->addItem(itemName);
-    }
-  va_end(itemlist);
-
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (widget), menu);
-  this->connectSignal ("changed", this->OptionChange);
-}
-
-/**
-   \brief Initializes a new Menu with no items
-*/
-void Menu::init(void)
-{
-  is_option = 2;
-
-  static_cast<Option*>(this)->init();
-
-  widget = gtk_option_menu_new ();
-  menu = gtk_menu_new ();
-
-}
-
-/**
- * Sets the Database-Name of this Menu
- \param title Database-Name to be set.
-*/
-void Menu::setTitle(char* title)
-{
-  label = title;
-}
-
-/**
-   \brief appends a new Item to the Menu-List.
-   \param itemName the itemName to be appendet.
-*/
-void Menu::addItem (char* itemName)
-{
-  item = gtk_menu_item_new_with_label (itemName);
-  gtk_menu_shell_append(GTK_MENU_SHELL (menu), item);
-}
-
-/** 
-    \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);
-  cout << static_cast<Menu*>(menu)->label << " changed to : " << static_cast<Menu*>(menu)->value << endl;
-}
-
-/**
-   \brief Redraws the widget
-   Example: see void CheckButton::redraw ()
- */
-void Menu::redraw ()
-{
-  gtk_option_menu_set_history (GTK_OPTION_MENU (widget), value);
-}
-
-/**
-   \brief Creates a new default Label with no Text.
-   You migth consider adding Label::setTitle with this.
-*/
-Label:: Label ()
-{
-  this->init();
-}
-
-/**
-   \brief Creates a new Label with a Text.
-   \param text The text to be displayed.
-*/
-Label:: Label (char* text)
-{
-  this->init();
-  this->setText(text);
-}
-
-/**
-   \brief initializes a new Label
-*/
-void Label::init(void)
-{
-  is_option = 0;
-
-  static_cast<Widget*>(this)->init();
-
-  widget = gtk_label_new ("");
-  gtk_label_set_line_wrap (GTK_LABEL(widget), TRUE);
-}
-
-/**
-   \brief Sets a new Text to a Label.
-   \param text The text to be inserted into the Label.
-*/
-void Label::setText (char* text)
-{
-  label = text;
-  gtk_label_set_text (GTK_LABEL (this->widget), text);
-}
-
-/**
-   \brief get the Text of a Label
-   \return The Text the Label holds.
-*/
-char* Label::getText ()
-{
-  return ((char*)gtk_label_get_text (GTK_LABEL (this->widget)));
-}
Index: /orxonox/trunk/gui/orxonox_gui.h
===================================================================
--- /orxonox/trunk/gui/orxonox_gui.h	(revision 3143)
+++ /orxonox/trunk/gui/orxonox_gui.h	(revision 3144)
@@ -10,4 +10,6 @@
 #include <config.h> 
 #endif
+
+#include "orxonox_gui_gtk.h"
 
 #include <stdlib.h>
@@ -36,243 +38,5 @@
 };
 
-//! This is the topmost object that can be displayed all others are derived from it.
-class Widget
-{
- private:
- 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
-  GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains.
-  void init(void);
-  int is_option; //!< with this Paramenter one can set the IsOption type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option
-  /**
-     \briefdefines is_option 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;
-  void connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *));
-  void connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *));
-  void connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *));
-  void connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *));
-  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);
-
-};
-
-//! This is a Packer Object, which has the ability to Pack other Widgets into itself.
-class Packer : public Widget
-{
- public:
-  Widget* down; //!< this points to the Widget below this.
-  char* groupName; //!< For each Packer you can specify a Groupname under which the lowerWidgets will be saved.
-
-  void init(void);
-  void setGroupName (char* name);
-  char* getGroupName (void);
-};
-
-//! This is a Container Class, it can contain one sub-Widget: down.
-/**
- * A Container is a Widget that can hold a subWidget in addition to a next-Widget.
- * The Container can by itself not be displayed created or used.
- * The derived classes of Container can be displayed
-*/
-class Container : public Packer
-{
- private:
-  int borderwidth;
-  int policy;
-  
- public:
-  void init(void);
-  //  void setBorderWidth (int borderwidth);
-  //  virtual void setTitle (char* title) = 0;
-  void fill (Widget *lowerWidget);
-};
-
-//! Window is the class that creates new Windows, and handels them
-/**
- * A Window is a class derived from Container that contains a window-widget.
- * It has the ability to hold one sub-object
- */
-class Window : public Container
-{
- private:
-  bool isOpen;
- public:
-  static Window* lastWindow;
-  Window (void);
-  Window (char* windowName);
-  void init ();
-  
-  void setTitle (char* title);
-  void showall (); 
-  static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
-};
-
-//! Frame is the class that handles frames
-/**
- * A Frame is an object, that has a border and if you like a name on it.
- * It can contain a Widget, which means that you can insert anything you like inside of a frame
- */
-class Frame :public Container
-{
- public:
-  Frame (char* frameName);
-  Frame (void);
-  void init(void);
-  
-  void setTitle (char* title);
-};
-
-//! EventBox is a Container that can Handle all Events happening inside of it.
-/**
- * Example: if you have a picture, and you want it to catch mouse-clicks, you have to pack it inside a EventBox
- */
-class EventBox : public Container
-{
- public:
-  EventBox (char* eventBoxName);
-  EventBox (void);
-  void init(void);
-  
-  void setTitle (char* title);
-};
-
-//! A Box can contain multiple Widgets
-/**
- * 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)
- */
-class Box : public Packer
-{
- public:
-  Box (void);
-  Box (char boxtype);
-  void init(char boxtype);
-
-  void fill (Widget* lowerWidget);
-
-};
-
-//! Image is the keeper of one Image 
-/** 
- * Images are mighty cool.
- * Images can help you lighten up the Programming process, and will give everyone a better impression of the Software.
- */
-class Image : public Widget
-{
- 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* flag_name; //!< options have a flag name that will be appendet if you start the Program from the GUI.
-  char* flag_name_short; //!< like flag_name but shorter
-  int default_value; //!< A default value is good, for hiding a option if it is not needed. (hidden if value == default_value)
-  bool saveable;
-
-  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);
-  static gint OptionChange (GtkWidget* widget, Widget* checkbutton);
-  
-  void init(void);
-  void setTitle(char* title);
-
-  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);
-
-  static gint OptionChange (GtkWidget* widget, Widget* slider);
-  void redraw();
-};
-
-//! A Menu is an Option that has a dropdown menu, where you can chose between different Items
-class Menu : public Option
-{
- private:
-  GtkWidget* menu;
-  GtkWidget* item;
-  va_list itemlist;
-  
- public:
-  Menu (char* menuname, ...);
-  void init(void);
-
-  void setTitle(char* title);
-
-  void addItem(char* itemName);
-  static gint OptionChange (GtkWidget* widget, Widget* menu);
-  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);
 
 #endif /* _ORXONOX_GUI_H */
Index: /orxonox/trunk/gui/orxonox_gui_gtk.cc
===================================================================
--- /orxonox/trunk/gui/orxonox_gui_gtk.cc	(revision 3144)
+++ /orxonox/trunk/gui/orxonox_gui_gtk.cc	(revision 3144)
@@ -0,0 +1,813 @@
+#include <iostream>
+
+#include "orxonox_gui_gtk.h"
+using namespace std;
+// temporarily.
+#include "orxonox_gui_flags.h"
+#include "orxonox_gui_exec.h"
+extern Window* orxonoxGUI;
+extern OrxonoxGuiFlags* flags;
+extern OrxonoxGuiExec* exec;
+
+/* WIDGET */
+
+/**
+   \brief deletes any given Widget
+   This is still pretty crappy.
+*/
+Widget::~Widget()
+{
+  //  cout << "hiding: " <<this->label <<"\n";
+  this->hide();
+  //  cout << "check if Packer: "<<this->label <<"\n";
+  if (this->is_option < 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;
+}
+
+/**
+   \brief Initializes a widget.
+   Initializes the next Pointer and the other Widget-specific Defaults.
+*/
+void Widget::init()
+{
+  next = NULL;
+  label = "";
+  return;
+}
+
+/**
+   \brief makes the widget visible.
+*/
+void Widget::show()
+{
+  gtk_widget_show (this->widget);
+}
+
+/**
+   \brief hides the widget.
+*/
+void Widget::hide()
+{
+  gtk_widget_hide (this->widget);
+}
+
+/**
+   \brief Sets the resolution of a specific widget to the given size.
+   \param width the width of the widget to set.
+   \param height the height of the widget to set.
+*/
+void Widget::setSize(int width, int height)
+{
+  gtk_widget_set_usize (this->widget, width, height);
+}
+
+/** 
+    \brief Connect any signal to any given Sub-widget
+*/
+void Widget::connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *))
+{
+  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL);
+}
+
+/**
+   \brief Connect a signal with additionally passing the whole Object
+*/
+void Widget::connectSignal (char* event, gint (*signal)( GtkWidget*, Widget *))
+{
+g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), this);
+}
+
+/**
+   \brief Connect a signal with additionally passing a whole external Object
+*/
+void Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *))
+{
+  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
+}
+
+/**
+   \brief Connect a signal with additionally passing a whole external Object
+*/
+void Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *))
+{
+  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
+}
+
+/**
+   \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*))
+{
+  function(this);
+  if (this->is_option < 0)
+    {
+      static_cast<Packer*>(this)->down->walkThrough (function);
+    } 
+
+  if (this->next != NULL)
+    this->next->walkThrough(function);
+}
+
+/** 
+    \brief This is for listing the option of "widget"
+    \param widget specifies the widget that should be listed
+*/
+void Widget::listOptions (Widget* widget)
+{
+  if (widget->is_option >= 1)
+    cout << static_cast<Option*>(widget)->label <<" is : " << static_cast<Option*>(widget)->value <<endl;
+}
+
+/** 
+    \brief This is for setting the option of "widget"
+    \param widget specifies the widget that should be set.
+*/
+void Widget::setOptions (Widget* widget)
+{
+  if (widget->is_option >= 1)
+    static_cast<Option*>(widget)->redraw();// <<" is : " << static_cast<Option*>(this)->value <<endl;
+}
+
+//void deleteWidget(Widget* lastWidget)
+
+
+/* PACKERS */
+
+/**
+   \brief Initializes a Packer.
+   Sets the down-pinter to NULL and other PackerSpecific-values to their defaults.
+*/
+void Packer::init (void)
+{
+  down = NULL;
+  this->setGroupName ("");
+
+
+  static_cast<Widget*>(this)->init();
+  return;
+}
+
+/**
+   \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)
+{
+  groupName = name;
+}
+
+/**
+   \brief Retrieves the group name under which all the lower widgets of this will be saved.
+   \returns name The name of the group.
+*/
+char* Packer::getGroupName (void)
+{
+  return groupName;
+}
+
+/* CONTAINERS */
+
+/**
+   \brief Initializes a Container.
+   sets the Container-Specific defaults.
+*/
+void Container::init (void)
+{
+  is_option = -1;
+
+  static_cast<Packer*>(this)->init();
+
+  return;
+}
+
+/**
+   \briefFills a Container with lowerWidget.
+   It does this by filling up the down pointer only if down points to NULL.
+   \param lowerWidget the Widget that should be filled into the Container.
+*/
+void Container::fill (Widget *lowerWidget)
+{
+  if (this->down == NULL)
+    {
+      gtk_container_add (GTK_CONTAINER (this->widget), lowerWidget->widget);
+      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"<<endl;
+}
+
+// gtk_container_set_border_width (GTK_CONTAINER (widget), 5);
+
+/* WINDOW */
+
+/**
+   \brief Creating a new Window without a Name
+*/
+Window::Window (void)
+{
+  this->init();
+}
+
+/**
+   \brief Creating a Window with a name
+   \param windowName the name the window should get.
+*/
+Window::Window (char* windowName)
+{
+  this->init();
+  this->setTitle (windowName);
+}
+
+Window* Window::lastWindow = NULL;
+
+/**
+   \brief initializes a new Window
+*/
+void Window::init()
+{
+  isOpen = false;
+
+  static_cast<Container*>(this)->init();
+
+  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);
+#endif 
+  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
+
+  //  printf("%p\n",lastWindow);
+
+  if (lastWindow !=NULL)
+    {
+      lastWindow->next = this;
+      printf("%p, %p\n", lastWindow, this);
+    }
+  Window::lastWindow = this;
+}
+
+/**
+   \brief Shows all Widgets that are included within this->widget.
+*/
+void Window::showall ()
+{
+  if (!isOpen)
+    {
+      printf ("showall\n");
+      gtk_widget_show_all  (widget);
+      isOpen = true;
+    }
+  else
+    {
+      printf ("showone\n");
+      gtk_widget_show (widget);
+    }
+}
+
+/**
+   \brief Set The Window-title to title
+   \param title title the Window should get.
+*/
+void Window::setTitle (char* title)
+{
+  label=title;
+  gtk_window_set_title (GTK_WINDOW (widget), title);
+}
+
+/**
+ * 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 (orxonoxGUI);
+
+  gtk_main_quit();
+  return FALSE;
+}
+
+
+/* FRAME */
+
+/** 
+    \brief Creates a new Frame without a name
+*/
+Frame::Frame (void)
+{
+  this->init();
+}
+
+/**
+   \brief Creates a new Frame with name title
+*/
+Frame::Frame (char* title)
+{
+  this->init();
+  this->setTitle(title);
+}
+
+/** 
+    \brief Initializes a new Frame with default settings
+*/
+void Frame::init()
+{
+  static_cast<Container*>(this)->init();
+  
+  widget = gtk_frame_new ("");
+  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
+}
+
+/**
+   \brief Sets the Frames name to title
+   \param title The title the Frame should get.
+*/
+void Frame::setTitle (char* title)
+{
+  label = title;
+  gtk_frame_set_label (GTK_FRAME (widget), title);
+}
+
+// EVENTBOX //
+
+/**
+   \brief Creates a new EventBox with default settings.
+*/
+EventBox::EventBox ()
+{
+  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)
+{
+  this->init();
+  this->setTitle(title);
+}
+
+/**
+   \brief Initializes a new EventBox
+*/
+void EventBox::init(void)
+{
+  is_option = -1;
+
+  static_cast<Container*>(this)->init();
+
+  widget = gtk_event_box_new ();
+  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
+ 
+}
+
+/**
+   \brief Sets the Title of the EventBox (not implemented)
+   \param title Name the EventBox should get (only datastructure-internal).
+*/
+void EventBox::setTitle (char* title)
+{
+  label = title;
+}
+
+/* BOX */
+
+/**
+   \brief Creates a new horizontal Box
+*/
+Box::Box (void)
+{
+  this->init('h');
+}
+
+/**
+   \brief Creates a new Box of type boxtype
+   \param boxtype if 'v' the Box will be vertically, if 'h' the Box will be horizontally
+*/
+Box::Box (char boxtype)
+{
+  this->init(boxtype);
+}
+
+/**
+   \brief Initializes a new Box with type boxtype
+   \param boxtype see Box(char boxtype)
+*/
+void Box::init(char boxtype)
+{
+  is_option = -2;
+
+  static_cast<Packer*>(this)->init();
+  if (boxtype == 'v')
+    {
+      widget = gtk_vbox_new (FALSE, 0);
+    }
+  else
+    {
+      widget = gtk_hbox_new (FALSE, 0);
+    }
+}
+
+/** 
+    \brief Fills a box with a given Widget.
+    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
+    \param lowerWidget the next Widget that should be appendet to this Box
+*/
+void Box::fill (Widget *lowerWidget)
+{
+  gtk_box_pack_start (GTK_BOX (this->widget), lowerWidget->widget, TRUE, TRUE, 0);
+  if (this->down == NULL)
+    this->down = lowerWidget;
+  else
+    {
+      Widget* tmp;
+      tmp = this->down;
+      while (tmp->next != NULL)
+	{
+	  tmp = tmp->next;
+	}
+      tmp->next = lowerWidget;
+    }
+}
+
+/* IMAGE */
+
+/**
+   \brief Creates a new Image
+   \param imagename the location of the Image on the Hard Disc
+*/
+Image::Image (char* imagename)
+{
+  this->init();
+  widget = gtk_image_new_from_file (imagename);
+  label = imagename;
+}
+
+/** 
+    \brief Initializes a new Image
+*/
+void Image::init()
+{
+  is_option = 0;
+
+  static_cast<Widget*>(this)->init();
+}
+
+
+/* OPTION */
+
+/**
+   \brief Initializes a new Option.
+   sets all Option-Specific-Values to their defaults.
+*/
+void Option::init()
+{
+  value = 0;
+  flag_name = "";
+  flag_name_short = "";
+  saveable = false;
+  default_value = 0;
+
+  static_cast<Widget*>(this)->init();
+
+  return;
+}
+
+/**
+   \brief This sets The FlagName of an Option and defines its default Values
+   !! Options will be saved if flagname is different from "" !!
+   \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)
+{
+  flag_name = flagname;
+  default_value = defaultvalue;
+  cout << "Set Flagname of " << label << " to " << flagname << endl;
+}
+
+/** 
+    \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 flagnameshort a short flagname to be displayed in the output
+*/
+void Option::setFlagName (char* flagname, char* flagnameshort,  int defaultvalue)
+{
+  flag_name = flagname;
+  flag_name_short = flagnameshort;
+  default_value = defaultvalue;
+  cout << "Set Flagname of " << label << " to " << flagname << endl;
+}
+
+
+/* BUTTON */
+
+/**
+   \brief Creates a new Button with a buttonname
+   \param buttonname sets the Name of the Button
+*/
+Button::Button(char* buttonname)
+{
+  this->init();
+  this->setTitle(buttonname);
+}
+
+/**
+   \brief Initializes a new Button
+*/
+void Button::init(void)
+{
+  is_option = 0;
+
+  static_cast<Option*>(this)->init();
+
+  widget = gtk_button_new_with_label ("");
+}
+
+/**
+   \brief Sets a new name to the Button
+   \param title The name the Button should get
+*/
+void Button::setTitle (char *title)
+{
+  label = title;
+  gtk_button_set_label (GTK_BUTTON(widget), title);
+}
+
+/**
+   \brief redraws the Button
+   not implemented yet
+*/
+void Button::redraw ()
+{
+}
+
+/* CHECKBUTTON */
+
+/**
+   \brief Creates a new CheckButton with an ame 
+   \param buttonname The name the CheckButton should display.
+*/
+CheckButton::CheckButton (char* buttonname)
+{
+  this->init();
+  this->setTitle(buttonname);
+
+  this->connectSignal ("clicked", this->OptionChange);
+}
+
+/**
+   \brief Initialize a new CheckButton with default settings
+*/
+void CheckButton::init(void)
+{
+  is_option = 1;
+
+  static_cast<Option*>(this)->init();
+
+  widget = gtk_check_button_new_with_label ("");
+}
+
+/**
+   \brief Sets a new Title to a CheckButton
+   \param title The new Name the CheckButton should display.
+*/
+void CheckButton::setTitle(char* title)
+{
+  label = title;
+  gtk_button_set_label(GTK_BUTTON(widget), title);
+}
+
+
+/** 
+    \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;
+}
+
+/**
+   \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 ()
+{
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), value);
+}
+
+/* SLIDER */
+
+/**
+   \brief Creates a new Slider
+   \param slidername The data-structure-name of the slider.
+   \param start The minimal Value of the slider.
+   \param end The maximal Value of the slider.
+*/
+Slider::Slider (char* slidername, int start, int end)
+{
+  this->init(start, end);
+  this->setValue(start);
+  this->setTitle(slidername);
+  this->connectSignal ("value_changed", this->OptionChange);
+}
+
+/**
+   \brief Initializes a Slider with start and end Values
+   params: see Slider::Slider (char* slidername, int start, int end)
+*/
+void Slider::init(int start, int end)
+{
+  is_option = 2;
+
+  static_cast<Option*>(this)->init();
+
+  widget = gtk_hscale_new_with_range (start, end, 5);
+}
+
+/**
+   \brief Sets a new Title to the Slider
+   \param title The new Name of the slider
+*/
+void Slider::setTitle(char* title)
+{
+  label = title;
+}
+
+/**
+   \brief Setting a new value to the Slider.
+   Maybe you also require a Slider::redraw() for this to display
+*/
+void Slider::setValue(int value)
+{
+  this->value = value;
+}
+
+/** 
+    \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;
+}
+
+/**
+   \brief Redraws the widget
+   Example: see void CheckButton::redraw ()
+*/
+void Slider::redraw ()
+{
+  gtk_range_set_value (GTK_RANGE (widget), value);
+}
+
+/* MENU */
+
+/** 
+    \brief Creates a Menu-Item-list out of multiple input.
+    !! Consider, that the last input argument has to be "lastItem" for this to work!!
+    \param menuname The Database-Name of this Menu
+    \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, ...)
+{
+  this->init();
+  this->setTitle(menuname);
+    
+  char *itemName;
+  
+  va_start (itemlist, menuname);
+  while (strcmp (itemName = va_arg (itemlist, char*), "lastItem"))
+    {
+      this->addItem(itemName);
+    }
+  va_end(itemlist);
+
+  gtk_option_menu_set_menu (GTK_OPTION_MENU (widget), menu);
+  this->connectSignal ("changed", this->OptionChange);
+}
+
+/**
+   \brief Initializes a new Menu with no items
+*/
+void Menu::init(void)
+{
+  is_option = 2;
+
+  static_cast<Option*>(this)->init();
+
+  widget = gtk_option_menu_new ();
+  menu = gtk_menu_new ();
+
+}
+
+/**
+ * Sets the Database-Name of this Menu
+ \param title Database-Name to be set.
+*/
+void Menu::setTitle(char* title)
+{
+  label = title;
+}
+
+/**
+   \brief appends a new Item to the Menu-List.
+   \param itemName the itemName to be appendet.
+*/
+void Menu::addItem (char* itemName)
+{
+  item = gtk_menu_item_new_with_label (itemName);
+  gtk_menu_shell_append(GTK_MENU_SHELL (menu), item);
+}
+
+/** 
+    \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;
+}
+
+/**
+   \brief Redraws the widget
+   Example: see void CheckButton::redraw ()
+ */
+void Menu::redraw ()
+{
+  gtk_option_menu_set_history (GTK_OPTION_MENU (widget), value);
+}
+
+/**
+   \brief Creates a new default Label with no Text.
+   You migth consider adding Label::setTitle with this.
+*/
+Label:: Label ()
+{
+  this->init();
+}
+
+/**
+   \brief Creates a new Label with a Text.
+   \param text The text to be displayed.
+*/
+Label:: Label (char* text)
+{
+  this->init();
+  this->setText(text);
+}
+
+/**
+   \brief initializes a new Label
+*/
+void Label::init(void)
+{
+  is_option = 0;
+
+  static_cast<Widget*>(this)->init();
+
+  widget = gtk_label_new ("");
+  gtk_label_set_line_wrap (GTK_LABEL(widget), TRUE);
+}
+
+/**
+   \brief Sets a new Text to a Label.
+   \param text The text to be inserted into the Label.
+*/
+void Label::setText (char* text)
+{
+  label = text;
+  gtk_label_set_text (GTK_LABEL (this->widget), text);
+}
+
+/**
+   \brief get the Text of a Label
+   \return The Text the Label holds.
+*/
+char* Label::getText ()
+{
+  return ((char*)gtk_label_get_text (GTK_LABEL (this->widget)));
+}
Index: /orxonox/trunk/gui/orxonox_gui_gtk.h
===================================================================
--- /orxonox/trunk/gui/orxonox_gui_gtk.h	(revision 3144)
+++ /orxonox/trunk/gui/orxonox_gui_gtk.h	(revision 3144)
@@ -0,0 +1,260 @@
+
+#ifndef _ORXONOX_GUI_GTK_H
+#define _ORXONOX_GUI_GTK_H
+#include <gtk/gtkmain.h>
+#include <gtk/gtkwindow.h>
+#include <gtk/gtkframe.h>
+#include <gtk/gtkhbox.h>
+#include <gtk/gtkvbox.h>
+#include <gtk/gtkbutton.h>
+#include <gtk/gtkcheckbutton.h>
+#include <gtk/gtkhscale.h>
+#include <gtk/gtkoptionmenu.h>
+#include <gtk/gtkmenu.h>
+#include <gtk/gtkmenuitem.h>
+#include <gtk/gtklabel.h>
+#include <gtk/gtkimage.h>
+#include <gtk/gtkeventbox.h>
+
+
+//! This is the topmost object that can be displayed all others are derived from it.
+class Widget
+{
+ private:
+ 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
+  GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains.
+  void init(void);
+  int is_option; //!< 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 is_option 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;
+  void connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *));
+  void connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *));
+  void connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *));
+  void connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *));
+  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);
+
+};
+
+//! This is a Packer Object, which has the ability to Pack other Widgets into itself.
+class Packer : public Widget
+{
+ public:
+  Widget* down; //!< this points to the Widget below this.
+  char* groupName; //!< For each Packer you can specify a Groupname under which the lowerWidgets will be saved.
+
+  void init(void);
+  void setGroupName (char* name);
+  char* getGroupName (void);
+};
+
+//! This is a Container Class, it can contain one sub-Widget: down.
+/**
+ * A Container is a Widget that can hold a subWidget in addition to a next-Widget.
+ * The Container can by itself not be displayed created or used.
+ * The derived classes of Container can be displayed
+*/
+class Container : public Packer
+{
+ private:
+  int borderwidth;
+  int policy;
+  
+ public:
+  void init(void);
+  //  void setBorderWidth (int borderwidth);
+  //  virtual void setTitle (char* title) = 0;
+  void fill (Widget *lowerWidget);
+};
+
+//! Window is the class that creates new Windows, and handels them
+/**
+ * A Window is a class derived from Container that contains a window-widget.
+ * It has the ability to hold one sub-object
+ */
+class Window : public Container
+{
+ private:
+  bool isOpen;
+ public:
+  static Window* lastWindow;
+  Window (void);
+  Window (char* windowName);
+  void init ();
+  
+  void setTitle (char* title);
+  void showall (); 
+  static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
+};
+
+//! Frame is the class that handles frames
+/**
+ * A Frame is an object, that has a border and if you like a name on it.
+ * It can contain a Widget, which means that you can insert anything you like inside of a frame
+ */
+class Frame :public Container
+{
+ public:
+  Frame (char* frameName);
+  Frame (void);
+  void init(void);
+  
+  void setTitle (char* title);
+};
+
+//! EventBox is a Container that can Handle all Events happening inside of it.
+/**
+ * Example: if you have a picture, and you want it to catch mouse-clicks, you have to pack it inside a EventBox
+ */
+class EventBox : public Container
+{
+ public:
+  EventBox (char* eventBoxName);
+  EventBox (void);
+  void init(void);
+  
+  void setTitle (char* title);
+};
+
+//! A Box can contain multiple Widgets
+/**
+ * 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)
+ */
+class Box : public Packer
+{
+ public:
+  Box (void);
+  Box (char boxtype);
+  void init(char boxtype);
+
+  void fill (Widget* lowerWidget);
+
+};
+
+//! Image is the keeper of one Image 
+/** 
+ * Images are mighty cool.
+ * Images can help you lighten up the Programming process, and will give everyone a better impression of the Software.
+ */
+class Image : public Widget
+{
+ 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* flag_name; //!< options have a flag name that will be appendet if you start the Program from the GUI.
+  char* flag_name_short; //!< like flag_name but shorter
+  int default_value; //!< A default value is good, for hiding a option if it is not needed. (hidden if value == default_value)
+  bool saveable;
+
+  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);
+  static gint OptionChange (GtkWidget* widget, Widget* checkbutton);
+  
+  void init(void);
+  void setTitle(char* title);
+
+  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);
+
+  static gint OptionChange (GtkWidget* widget, Widget* slider);
+  void redraw();
+};
+
+//! A Menu is an Option that has a dropdown menu, where you can chose between different Items
+class Menu : public Option
+{
+ private:
+  GtkWidget* menu;
+  GtkWidget* item;
+  va_list itemlist;
+  
+ public:
+  Menu (char* menuname, ...);
+  void init(void);
+
+  void setTitle(char* title);
+
+  void addItem(char* itemName);
+  static gint OptionChange (GtkWidget* widget, Widget* menu);
+  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);
+
+#endif /* _ORXONOX_GUI_GTK_H */
