Index: /orxonox/trunk/gui/orxonox_gui.cc
===================================================================
--- /orxonox/trunk/gui/orxonox_gui.cc	(revision 3151)
+++ /orxonox/trunk/gui/orxonox_gui.cc	(revision 3152)
@@ -54,5 +54,4 @@
 int main( int argc, char *argv[] )
 {
-  Window::lastWindow = NULL;
   OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv);
   return 0;
Index: /orxonox/trunk/gui/orxonox_gui_gtk.cc
===================================================================
--- /orxonox/trunk/gui/orxonox_gui_gtk.cc	(revision 3151)
+++ /orxonox/trunk/gui/orxonox_gui_gtk.cc	(revision 3152)
@@ -277,6 +277,4 @@
 }
 
-Window* Window::lastWindow = NULL;
-
 /**
    \brief initializes a new Window
@@ -286,5 +284,5 @@
   if (!mainWindow)
     mainWindow = this;
-
+  
   isOpen = false;
 
@@ -298,12 +296,4 @@
   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;
 }
 
Index: /orxonox/trunk/gui/orxonox_gui_gtk.h
===================================================================
--- /orxonox/trunk/gui/orxonox_gui_gtk.h	(revision 3151)
+++ /orxonox/trunk/gui/orxonox_gui_gtk.h	(revision 3152)
@@ -92,5 +92,4 @@
   static void addWindow(Window* windowToAdd);
 
-  static Window* lastWindow;
   Window (void);
   Window (char* windowName);
Index: /orxonox/trunk/gui/orxonox_gui_keys.cc
===================================================================
--- /orxonox/trunk/gui/orxonox_gui_keys.cc	(revision 3151)
+++ /orxonox/trunk/gui/orxonox_gui_keys.cc	(revision 3152)
@@ -60,29 +60,31 @@
   openButton->connectSignal("button_press_event", this, openWindowEvent);
 
-  keyWindow = new Window("keys of player");
-
-  keysBox = new Box('v');
-  keysBox->fill(addKey(UP, "up"));
-  keysBox->fill(addKey(DOWN, "down"));
-  keysBox->fill(addKey(LEFT, "left"));
-  keysBox->fill(addKey(RIGHT, "right"));
-  keysBox->fill(addKey(SHOOT, "shoot"));
-  keyWindow->fill(keysBox);
-  windowIsOpen = false;
-
+  pKeyWindow = new Window("keys of player");
+   pKeysBox = new Box('v');
+    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"));
+    
+    closeButton = new Button("close");
+    closeButton->connectSignal("button_press_event", this, closeWindowEvent);
+    pKeysBox->fill(closeButton);
+   pKeyWindow->fill(pKeysBox);
+   //  Window::addWindow(pKeyWindow);
 }
 
 Widget* Player::addKey (KEYS key, char* name)
 {
-  keyBox[key] = new Box();
-  keyLabel[key] = new Label (name);
-  keyButton[key] = new Button(name);
-  keyButton[key]->saveable;
+  pKeyBox[key] = new Box();
+  pKeyLabel[key] = new Label (name);
+  pKeyButton[key] = new Button(name);
+  pKeyButton[key]->saveable = true;
   
-  keyButton[key]->connectSignal("key_press_event", keyButton[key], key_cb);
+  pKeyButton[key]->connectSignal("key_press_event", pKeyButton[key], key_cb);
   
-  keyBox[key]->fill(keyLabel[key]);
-  keyBox[key]->fill(keyButton[key]);
-  return keyBox[key];
+  pKeyBox[key]->fill(pKeyLabel[key]);
+  pKeyBox[key]->fill(pKeyButton[key]);
+  return pKeyBox[key];
 }
 
@@ -96,26 +98,15 @@
 {
   cout << "setting up Key: "<< key <<endl;
-
-}
-
-/**
-   \brief function to display, hide the palyer window
-   Buggy, segmentation fault on WindowMaker
-*/
-void Player::openWindow ()
-{
-  if (!windowIsOpen)
-    keyWindow->showall();
-  else
-    keyWindow->hide();
-  windowIsOpen = !windowIsOpen;
 }
 
 gint Player::openWindowEvent (GtkWidget* widget, GdkEvent* event, void* player)
 {
-
-  static_cast<Player*>(player)->openWindow();
-}
-
+  static_cast<Player*>(player)->pKeyWindow->open();
+}
+
+gint Player::closeWindowEvent (GtkWidget* widget, GdkEvent* event, void* player)
+{
+  static_cast<Player*>(player)->pKeyWindow->close();
+}
 
 /**
Index: /orxonox/trunk/gui/orxonox_gui_keys.h
===================================================================
--- /orxonox/trunk/gui/orxonox_gui_keys.h	(revision 3151)
+++ /orxonox/trunk/gui/orxonox_gui_keys.h	(revision 3152)
@@ -15,35 +15,5 @@
 enum KEYS { UP, DOWN, LEFT, RIGHT, SHOOT };
 
-//! Class to hold infos about a Player
-class Player
-{
- private:
-  Window* keyWindow;
-  bool windowIsOpen;
-  Button* openButton;
-
-
-  Box* keysBox;
-  
-  Box* keyBox[10];
-  Button* keyButton[10];
-  Label* keyLabel[10];
-
-
- public:
-  Player(char* player);
-
-  Widget* addKey (KEYS key, char* name);
-
-  Button* getOpenButton();
-  
-  void openWindow ();
-
-  static gint openWindowEvent(GtkWidget* widget, GdkEvent* event, void* player);
-  static gint key_cb(GtkWidget* w, GdkEventKey* event, void* widget);
-  void setkey(KEYS key);
-  
-};
-
+class Player;
 //! Class that creates the Keys-Options.
 class OrxonoxGuiKeys
@@ -63,4 +33,31 @@
 };
 
+//! Class to hold infos about a Player
+class Player
+{
+ private:
+  Window* pKeyWindow;
+  Button* openButton;
+  Button* closeButton;
+  Box* pKeysBox;
+  
+  Box* pKeyBox[10];
+  Button* pKeyButton[10];
+  Label* pKeyLabel[10];
+
+
+ public:
+  Player(char* player);
+
+  Widget* addKey (KEYS key, char* name);
+
+  Button* getOpenButton();
+
+  static gint openWindowEvent(GtkWidget* widget, GdkEvent* event, void* player);
+  static gint closeWindowEvent(GtkWidget* widget, GdkEvent* event, void* player);
+  static gint key_cb(GtkWidget* w, GdkEventKey* event, void* widget);
+  void setkey(KEYS key);
+  
+};
 
 
