title: how to set gtkmm window to open in the centre of the screen?
body: <p>I am trying make my windows in GTKmm open in the centre of the screen and I can't find a working solution anywhere online.  Any insights?</p>
  
  <p>I have been trying everything I can think of with no results...</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include "viewMenu.h"
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #define MAX_BUF 10
  
  viewMenu::viewMenu()
  : frmMenu("cuTAES Review Menu"), 
    lblChooser("Select Course : "), 
    lblCourses(""),
    lblView(" View "),
   lblAppInfo(" Application Info "), 
    lblStuInfo(" Student Info "), 
    btnView(" View this Application "), 
    btnBack(" Back "),
    frameTable(4,4,true)
  {
    set_title("cuTAES Review Menu ");
    //set_border_width(50);
    add(frameTable);
  
    window.set_position(Gtk::WIN_POS_CENTER);
  
    //frmMenu.add(lblChooser);
    //frameTable.attach(frmMenu,0,1,0,0);
  
    frameTable.attach(lblChooser, 1,2,0,1);
    char text[MAX_BUF];
    std::ifstream inFile("courses.txt", std::ios::in);
    if(!inFile){
      exit(1);
    }
    while(!inFile.eof()) {
      inFile.getline(text,MAX_BUF);
      cboCourse.append(text);
    }
  
    frameTable.attach(cboCourse, 2,3,0,1);
  
    //set up my table
    frameTable.attach(lblView, 0,1,0,1);
    frameTable.attach(lblStuInfo, 0,1,1,2);
    frameTable.attach(lblAppInfo, 2,3,1,2);
    btnView.signal_clicked().connect(sigc::mem_fun(*this,&amp;viewMenu::btnView_clicked));
    frameTable.attach(btnView,3,4,0,1);
  
    btnBack.signal_clicked().connect(sigc::mem_fun(*this, &amp;viewMenu::btnBack_clicked));
    frameTable.attach(btnBack,3,4,3,4);
  
    show_all_children();
  }
  </code></pre>
  
  <p>and my Header file:</p>
  
  <pre><code>#ifndef VIEWMENU_H
  #define VIEWMENU_H
  
  #include &lt;gtkmm.h&gt;
  
  class viewMenu : public Gtk::Window
  {
  
  public:
    viewMenu();
    virtual ~viewMenu();
  
  protected:
    //Signal handlers:
    void btnView_clicked();
  
    void btnBack_clicked();
  
    //Member widgets:
    Gtk::Table frameTable;
    Gtk::Label lblChooser,lblCourses, lblView, lblAppInfo, lblStuInfo, lblCourseDrop;  
    Gtk::Frame frmMenu;
    Gtk::Button btnView, btnBack;
    Gtk::ComboBoxText cboCourse;
    Gtk::Window window;
  };
  
  #endif // MAINMENU_H
  </code></pre>