Index: /orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.cc
===================================================================
--- /orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.cc	(revision 3622)
+++ /orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.cc	(revision 3623)
@@ -133,19 +133,8 @@
 
 /* WIDGET */
-
-/**
-   \brief deletes any given Widget
-   This is still pretty crappy.
-*/
-Widget::~Widget(void)
-{
-  this->destroy();
-}
-
-/**
-   \brief Initializes a widget.
-   Initializes the next Pointer and the other Widget-specific Defaults.
-*/
-void Widget::init(void)
+/**
+   \brief constructs a Widget
+*/
+Widget::Widget(void)
 {
   next = NULL;
@@ -155,9 +144,10 @@
 
 /**
-   \brief Destroys a Widget 
-*/
-void Widget::destroy(void)
-{
-  if (this->title)
+   \brief deletes any given Widget
+   This is still pretty crappy.
+*/
+Widget::~Widget(void)
+{
+    if (this->title)
     {
       delete []this->title;
@@ -172,5 +162,4 @@
     delete this->next;
   this->next = NULL;
-
   //!  \todo not hiding widget, deleting.
   //  this->hide();
@@ -513,18 +502,11 @@
 
 /* PACKERS */
-
-/**
-   \brief Initializes a Packer.
-
-   Sets the down-pinter to NULL and other PackerSpecific-values to their defaults.
-*/
-void Packer::init(void)
+/**
+   \brief Constructs a Packer
+*/
+Packer::Packer(void)
 {
   this->down = NULL;
   this->groupName = NULL;
-
-
-  static_cast<Widget*>(this)->init();
-  return;
 }
 
@@ -532,5 +514,5 @@
    \brief Destroys a Packer.
 */
-void Packer::destroy(void)
+Packer::~Packer(void)
 { 
   PRINTF(4)("deleting the Packer part.\n");
@@ -543,6 +525,4 @@
     delete this->down;
   this->down = NULL;
-
-  static_cast<Widget*>(this)->destroy();
 }
 
@@ -575,11 +555,7 @@
    sets the Container-Specific defaults.
 */
-void Container::init(void)
+Container::Container(void)
 {
   this->isOption = -1;
-
-  static_cast<Packer*>(this)->init();
-
-  return;
 }
 
@@ -587,9 +563,7 @@
    \brief Destroys a Container.
 */
-void Container::destroy(void)
+Container::~Container(void)
 { 
   PRINTF(4)("deleting the Container part.\n");
-
-  static_cast<Packer*>(this)->destroy();
 }
 
@@ -665,5 +639,9 @@
 Window::~Window(void)
 {
-  this->destroy();
+  if (this->title)
+    PRINTF(3)("deleting the Window: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the Window.\n");
+  //  this->hide();
 }
 
@@ -677,6 +655,4 @@
   
   isOpen = false;
-
-  static_cast<Container*>(this)->init();
 
 #ifdef HAVE_GTK2
@@ -691,18 +667,4 @@
 
 /**
-   \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();
-  
-}
-
-/**
    \brief Shows all Widgets that are included within this->widget.
 */
@@ -823,31 +785,19 @@
 Frame::~Frame(void)
 {
-  this->destroy();
-}
-
-/** 
-    \brief Initializes a new Frame with default settings
-*/
-void Frame::init(void)
-{
-  static_cast<Container*>(this)->init();
-
-#ifdef 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();
+}
+
+/** 
+    \brief Initializes a new Frame with default settings
+*/
+void Frame::init(void)
+{
+#ifdef HAVE_GTK2
+  this->widget = gtk_frame_new("");
+  gtk_container_set_border_width(GTK_CONTAINER(this->widget), 3);
+#endif /* HAVE_GTK2 */
 }
 
@@ -892,34 +842,21 @@
 EventBox::~EventBox(void)
 {
-  this->destroy();
-
-}
-
-/**
-   \brief Initializes a new EventBox
-*/
-void EventBox::init(void)
-{
-  this->isOption = -1;
-
-  static_cast<Container*>(this)->init();
-
-#ifdef HAVE_GTK2
-  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 Initializes a new EventBox
+*/
+void EventBox::init(void)
+{
+  this->isOption = -1;
+
+#ifdef HAVE_GTK2
+  this->widget = gtk_event_box_new();
+  gtk_container_set_border_width(GTK_CONTAINER(this->widget), 3);
+#endif /* HAVE_GTK2 */
 }
 
@@ -960,33 +897,4 @@
 Box::~Box(void)
 {
-  this->destroy();
-}
-
-/**
-   \brief Initializes a new Box with type boxtype
-   \param boxtype see Box(char boxtype)
-*/
-void Box::init(char boxtype)
-{
-  this->isOption = -2;
-
-  static_cast<Packer*>(this)->init();
-#ifdef HAVE_GTK2
-  if (boxtype == 'v')
-    {
-      this->widget = gtk_vbox_new(FALSE, 0);
-    }
-  else
-    {
-      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);
@@ -994,5 +902,24 @@
     PRINTF(3)("deleting the Box.\n");
 
-  static_cast<Packer*>(this)->destroy();
+}
+
+/**
+   \brief Initializes a new Box with type boxtype
+   \param boxtype see Box(char boxtype)
+*/
+void Box::init(char boxtype)
+{
+  this->isOption = -2;
+
+#ifdef HAVE_GTK2
+  if (boxtype == 'v')
+    {
+      this->widget = gtk_vbox_new(FALSE, 0);
+    }
+  else
+    {
+      this->widget = gtk_hbox_new(FALSE, 0);
+    }
+#endif /* HAVE_GTK2 */
 }
 
@@ -1040,5 +967,5 @@
    sets all Option-Specific-Values to their defaults.
 */
-void Option::init(void)
+Option::Option(void)
 {
   this->value = 0;
@@ -1047,8 +974,4 @@
   this->saveable = false;
   this->defaultValue = 0;
-
-  static_cast<Widget*>(this)->init();
-
-  return;
 }
 
@@ -1056,5 +979,5 @@
    \brief Destroys an Option.
 */
-void Option::destroy(void)
+Option::~Option(void)
 { 
   PRINTF(4)("deleting the Option Part.\n");
@@ -1063,6 +986,4 @@
   if (this->flagNameShort)
     delete []this->flagNameShort;
-
-  static_cast<Widget*>(this)->destroy();
 }
 
@@ -1161,26 +1082,4 @@
 Button::~Button(void)
 {
-  this->destroy();
-}
-
-/**
-   \brief Initializes a new Button
-*/
-void Button::init(void)
-{
-  isOption = 0;
-
-  static_cast<Option*>(this)->init();
-
-#ifdef 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);
@@ -1188,5 +1087,16 @@
     PRINTF(3)("deleting the Label.\n");
 
-  static_cast<Option*>(this)->destroy();
+}
+
+/**
+   \brief Initializes a new Button
+*/
+void Button::init(void)
+{
+  isOption = 0;
+
+#ifdef HAVE_GTK2
+  widget = gtk_button_new_with_label("");
+#endif /* HAVE_GTK2 */
 }
 
@@ -1245,32 +1155,20 @@
 CheckButton::~CheckButton(void)
 {
-  this->destroy();
-}
-
-/**
-   \brief Initialize a new CheckButton with default settings
-*/
-void CheckButton::init(void)
-{
-  this->isOption = 1;
-
-  static_cast<Option*>(this)->init();
-
-#ifdef 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();
+}
+
+/**
+   \brief Initialize a new CheckButton with default settings
+*/
+void CheckButton::init(void)
+{
+  this->isOption = 1;
+
+#ifdef HAVE_GTK2
+  this->widget = gtk_check_button_new_with_label("");
+#endif /* HAVE_GTK2 */
 }
 
@@ -1350,36 +1248,23 @@
 Slider::~Slider(void)
 {
-  this->destroy();
-}
-
-/**
-   \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)
-{
-  this->isOption = 2;
-
-  static_cast<Option*>(this)->init();
-
-  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();
-
+}
+
+/**
+   \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)
+{
+  this->isOption = 2;
+
+  this->start = start;
+  this->end = end;
+#ifdef HAVE_GTK2
+ widget = gtk_hscale_new_with_range(this->start, this->end, 5);
+#endif /* HAVE_GTK2 */
 }
 
@@ -1471,28 +1356,4 @@
 Menu::~Menu(void)
 {
-  this->destroy();
-}
-
-/**
-   \brief Initializes a new Menu with no items
-*/
-void Menu::init(void)
-{
-  this->isOption = 2;
-
-  static_cast<Option*>(this)->init();
-
-#ifdef 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);
@@ -1500,8 +1361,20 @@
     PRINTF(3)("deleting the Menu.\n");
   //! \todo destroy menu
-  
-  static_cast<Option*>(this)->destroy();
-}
-
+
+}
+
+/**
+   \brief Initializes a new Menu with no items
+*/
+void Menu::init(void)
+{
+  this->isOption = 2;
+
+#ifdef HAVE_GTK2
+  this->widget = gtk_option_menu_new();
+  this->menu = gtk_menu_new();
+#endif /* HAVE_GTK2 */
+
+}
 
 /**
@@ -1578,27 +1451,4 @@
 OptionLabel::~OptionLabel(void)
 {
-  this->destroy();
-}
-
-/**
-   \brief Initializes an OptionLabel
-*/
-void OptionLabel::init(void)
-{
-  this->isOption = 5;
-  static_cast<Option*>(this)->init();
-
-  cValue = NULL;
-
-#ifdef 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);
@@ -1607,8 +1457,18 @@
   if (this->cValue)
     delete []this->cValue;
-
-  static_cast<Option*>(this)->destroy();
-}
-
+}
+
+/**
+   \brief Initializes an OptionLabel
+*/
+void OptionLabel::init(void)
+{
+  this->isOption = 5;
+  cValue = NULL;
+
+#ifdef HAVE_GTK2
+  this->widget = gtk_label_new("");
+#endif /* HAVE_GTK2 */
+}
 
 /**
@@ -1689,33 +1549,21 @@
 Label::~Label(void)
 {
-  this->destroy();
-}
-
-/**
-   \brief initializes a new Label
-*/
-void Label::init(void)
-{
-  this->isOption = 0;
-
-  static_cast<Widget*>(this)->init();
-
-#ifdef 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();
+}
+
+/**
+   \brief initializes a new Label
+*/
+void Label::init(void)
+{
+  this->isOption = 0;
+
+#ifdef HAVE_GTK2
+  this->widget = gtk_label_new("");
+  gtk_label_set_line_wrap(GTK_LABEL(this->widget), TRUE);
+#endif /* HAVE_GTK2 */
 }
 
@@ -1813,5 +1661,8 @@
 ProgressBar::~ProgressBar(void)
 {
-  this->destroy();
+  if (this->title)
+    PRINTF(3)("deleting the ProgressBar: %s\n", this->title);
+  else 
+    PRINTF(3)("deleting the ProgressBar.\n");
 }
 
@@ -1825,22 +1676,8 @@
   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();
 }
 
@@ -1913,28 +1750,16 @@
 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 Initializes a new Image
+*/
+void Image::init(void)
+{
+  isOption = 0;
 }
 
Index: /orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.h
===================================================================
--- /orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.h	(revision 3622)
+++ /orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.h	(revision 3623)
@@ -39,7 +39,6 @@
 
  public:
+  Widget(void);
   virtual ~Widget(void);
-  void init(void);
-  void destroy(void);
 
   void show(void);
@@ -90,9 +89,9 @@
 {
  public:
+  Packer(void);
+  virtual ~Packer(void);
+
   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 destroy(void);
 
   void setGroupName(char* name);
@@ -115,7 +114,6 @@
   
  public:
-  void init(void);
-  void destroy(void);
-
+  Container(void);
+  virtual ~Container(void);
   //  void setBorderWidth(int borderwidth);
   //  virtual void setTitle(char* title) = 0;
@@ -138,7 +136,6 @@
   Window(void);
   Window(char* windowName);
-  ~Window(void);
-  void init(void);
-  void destroy(void);
+  virtual ~Window(void);
+  void init(void);
   
   void setTitle(char* title);
@@ -164,7 +161,6 @@
   Frame(void);
   Frame(char* frameName);
-  ~Frame(void);
-  void init(void);
-  void destroy(void);
+  virtual ~Frame(void);
+  void init(void);
   
   void setTitle(char* title);
@@ -180,7 +176,6 @@
   EventBox(void);
   EventBox(char* eventBoxName);
-  ~EventBox(void);
-  void init(void);
-  void destroy(void);
+  virtual ~EventBox(void);
+  void init(void);
   
   void setTitle(char* title);
@@ -198,7 +193,6 @@
   Box(void);
   Box(char boxtype);
-  ~Box(void);
+  virtual ~Box(void);
   void init(char boxtype);
-  void destroy(void);
   
   void fill(Widget* lowerWidget);
@@ -217,6 +211,7 @@
   
  public:
-  void init(void);
-  void destroy(void);
+  Option(void);
+  virtual ~Option(void);
+  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
@@ -246,7 +241,6 @@
  public:
   Button(char* buttonname);
-  ~Button(void);
-  void init(void);
-  void destroy(void);
+  virtual ~Button(void);
+  void init(void);
 
   void setTitle(char* title);
@@ -262,7 +256,6 @@
  public:
   CheckButton(char* buttonname);
-  ~CheckButton(void);
-  void init(void);
-  void destroy(void);
+  virtual ~CheckButton(void);
+  void init(void);
 
   void setTitle(char* title);
@@ -283,7 +276,6 @@
  public:
   Slider(char* slidername, int start, int end);
-  ~Slider(void);
+  virtual ~Slider(void);
   void init(int start, int end);
-  void destroy(void);
 
   void setTitle(char* title);
@@ -305,7 +297,6 @@
  public:
   Menu(char* menuname, ...);
-  ~Menu(void);
-  void init(void);
-  void destroy(void);
+  virtual ~Menu(void);
+  void init(void);
   
   void setTitle(char* title);
@@ -322,8 +313,6 @@
  public:
   OptionLabel(char* label, char* value);
-  ~OptionLabel(void);
-  void init(void);
-  void destroy(void);
-  
+  virtual ~OptionLabel(void);
+  void init(void);
   
   void setValue(char* newValue);
@@ -342,7 +331,6 @@
   Label(void);
   Label(char* text);
-  ~Label(void);
-  void init(void);
-  void destroy(void);
+  virtual ~Label(void);
+  void init(void);
   
   void setTitle(char* text);
@@ -359,7 +347,6 @@
   ProgressBar(void);
   ProgressBar(char* label);
-  ~ProgressBar(void);
-  void init(void);
-  void destroy(void);
+  virtual ~ProgressBar(void);
+  void init(void);
 
   void setTitle(char* title);
@@ -385,7 +372,6 @@
  public:
   Image(char* imgaename);
-  ~Image(void);
-  void init(void);
-  void destroy(void);
+  virtual ~Image(void);
+  void init(void);
 
   void setTitle(char* title);
