Index: /branches/gui/src/lib/gui/gl/glgui.h
===================================================================
--- /branches/gui/src/lib/gui/gl/glgui.h	(revision 8615)
+++ /branches/gui/src/lib/gui/gl/glgui.h	(revision 8616)
@@ -16,5 +16,4 @@
 #include "glgui_button.h"
 #include "glgui_checkbutton.h"
-//#include "glgui_colorselector.h"
 #include "glgui_pushbutton.h"
 #include "glgui_slider.h"
@@ -22,4 +21,5 @@
 #include "glgui_inputline.h"
 #include "glgui_textfield.h"
+#include "glgui_table.h"
 #include "glgui_image.h"
 
Index: /branches/gui/src/lib/gui/gl/glgui_table.cc
===================================================================
--- /branches/gui/src/lib/gui/gl/glgui_table.cc	(revision 8615)
+++ /branches/gui/src/lib/gui/gl/glgui_table.cc	(revision 8616)
@@ -17,4 +17,5 @@
 
 #include "glgui_table.h"
+#include "debug.h"
 
 namespace OrxGui
@@ -23,7 +24,9 @@
    * @brief standard constructor
    */
-  GLGuiTable::GLGuiTable ()
+  GLGuiTable::GLGuiTable (unsigned int rows, unsigned int columns)
   {
     this->init();
+    this->setRowCount(rows);
+    this->setColumnCount(columns);
   }
 
@@ -51,7 +54,12 @@
   void GLGuiTable::setRowCount(unsigned int rowCount)
   {
-    this->_headers.resize(rowCount);
-    for (unsigned int i = 0; i < rowCount; i++)
-      this->_entries[i].resize(rowCount);
+
+    unsigned int currentRowCount = this->rowCount();
+    this->_entries.resize(rowCount);
+    for (unsigned int i = currentRowCount; i < this->rowCount(); ++i)
+      this->_entries[i].resize(columnCount(), LimitedWidthText("fonts/final_frontier.ttf", 20));
+
+    assert(this->checkIntegrity());
+    this->debug();
 
     if (!this->isVisible())
@@ -61,5 +69,11 @@
   void GLGuiTable::setColumnCount(unsigned int columnCount)
   {
-    this->_entries.resize(columnCount);
+    this->_headers.resize(columnCount, LimitedWidthText("fonts/final_frontier.ttf", 20));
+    for (unsigned int i = 0; i < rowCount(); i++)
+      this->_entries[i].resize(columnCount, LimitedWidthText("fonts/final_frontier.ttf", 20));
+
+    assert(this->checkIntegrity());
+    this->debug();
+
     if (!this->isVisible())
       this->hiding();
@@ -69,5 +83,5 @@
   void GLGuiTable::setHeader(unsigned int number, const std::string& headerName)
   {
-    if (number >= this->_headers.size())
+    if (number >= this->columnCount())
       this->setColumnCount(number + 1);
     this->_headers[number].setText(headerName);
@@ -97,6 +111,7 @@
   }
 
+  /// TODO.
   void GLGuiTable::setRowHeight(unsigned int row, unsigned int size)
-  {}
+{}
 
 
@@ -134,9 +149,9 @@
   void GLGuiTable::updateFrontColor()
   {
-    for (unsigned int i = 0; i < this->rowCount(); ++i)
+    for (unsigned int i = 0; i < this->columnCount(); ++i)
     {
       this->_headers[i].setColor(this->foregroundColor());
-      for (unsigned int j = 0; j < this->columnCount(); ++j)
-        this->_entries[i][j].setColor(this->foregroundColor());
+      for (unsigned int j = 0; j < this->rowCount(); ++j)
+        this->_entries[j][i].setColor(this->foregroundColor());
     }
   }
@@ -144,9 +159,9 @@
   void GLGuiTable::hiding()
   {
-    for (unsigned int i = 0; i < this->rowCount(); ++i)
+    for (unsigned int i = 0; i < this->columnCount(); ++i)
     {
       this->_headers[i].setVisibility(false);
-      for (unsigned int j = 0; j < this->columnCount(); ++j)
-        this->_entries[i][j].setVisibility(false);
+      for (unsigned int j = 0; j < this->rowCount(); ++j)
+        this->_entries[j][i].setVisibility(false);
     }
   }
@@ -154,11 +169,12 @@
   void GLGuiTable::showing()
   {
-    for (unsigned int i = 0; i < this->rowCount(); ++i)
+    for (unsigned int i = 0; i < this->columnCount(); ++i)
     {
       this->_headers[i].setVisibility(true);
-      for (unsigned int j = 0; j < this->columnCount(); ++j)
-        this->_entries[i][j].setVisibility(true);
-    }
-  }
+      for (unsigned int j = 0; j < this->rowCount(); ++j)
+        this->_entries[j][i].setVisibility(true);
+    }
+  }
+
 
   /**
@@ -182,3 +198,35 @@
     this->endDraw();
   }
+
+  void GLGuiTable::debug() const
+  {
+    PRINT(0)("Table: Size = %dx%d\n", this->rowCount(), this->columnCount());
+
+    for (unsigned int i = 0; i < this->rowCount(); ++i)
+      PRINT(0)("line %d: columns %d\n", i, this->_entries[i].size());
+  }
+
+
+  bool GLGuiTable::checkIntegrity() const
+  {
+    bool retVal = true;
+    if (rowCount() != this->_entries.size())
+    {
+      PRINTF(1)("ROW COUNT WRONG (is %d should be %d)\n", rowCount(), this->_entries.size());
+      retVal = false;
+    }
+    if (columnCount() != this->_headers.size())
+    {
+      PRINTF(1)("COLUMN COUNT WRONG (is %d should be %d)\n", columnCount(), this->_headers.size());
+      retVal = false;
+    }
+    for (unsigned int i = 0; i < this->rowCount(); ++i)
+      if (this->_entries[i].size() != this->columnCount())
+    {
+      PRINTF(1)("COLUMN-COUNT OF ROW %d WRONG (is %d should be %d)\n", i, this->_entries[i].size(), this->columnCount());
+      retVal = false;
+    }
+    return retVal;
+  }
+
 }
Index: /branches/gui/src/lib/gui/gl/glgui_table.h
===================================================================
--- /branches/gui/src/lib/gui/gl/glgui_table.h	(revision 8615)
+++ /branches/gui/src/lib/gui/gl/glgui_table.h	(revision 8616)
@@ -27,11 +27,9 @@
 
   public:
-    GLGuiTable();
+    GLGuiTable(unsigned int rows, unsigned int columns);
     virtual ~GLGuiTable();
 
+    unsigned int rowCount() const { return this->_entries.size(); };
     unsigned int columnCount() const { return this->_headers.size(); };
-    unsigned int rowCount() const { return this->_entries.size(); };
-    //const std::vector<std::string>& headers() const { return this->_headers; };
-    //const std::vector<std::vector<std::string> >& entries() const { return this->_entries; };
 
     void setRowCount(unsigned int rowCount);
@@ -50,4 +48,6 @@
 
 
+    void debug() const;
+
   protected:
     virtual void removedFocus();
@@ -64,4 +64,6 @@
     void init();
 
+    bool checkIntegrity() const;
+
   private:
     typedef std::vector<LimitedWidthText> TableTextList;
Index: /branches/gui/src/story_entities/simple_game_menu.cc
===================================================================
--- /branches/gui/src/story_entities/simple_game_menu.cc	(revision 8615)
+++ /branches/gui/src/story_entities/simple_game_menu.cc	(revision 8616)
@@ -123,4 +123,15 @@
     slider->setValue(slider->min());
     box->pack(slider);
+
+
+    OrxGui::GLGuiTable* table = new OrxGui::GLGuiTable(3, 3);
+    std::vector<std::string> headers;
+    headers.push_back("1");
+    headers.push_back("2");
+    headers.push_back("3");
+    table->setHeader(headers);
+
+
+    box->pack(table);
   }
   box->setAbsCoor2D(50, 200);
