]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/engineer.cpp
Use a GLtk::Layout with FloatingArrangement to manage dialogs
[r2c2.git] / source / engineer / engineer.cpp
index fb21f9917b0e718b4031e0e8a42937aea3375d67..c88bae8e24648cd09f8566d09c1dbf3ddbcb2607 100644 (file)
@@ -12,6 +12,7 @@
 #include <msp/gl/matrix.h>
 #include <msp/gl/misc.h>
 #include <msp/gl/tests.h>
+#include <msp/gltk/floatingarrangement.h>
 #include <msp/io/print.h>
 #include <msp/strings/format.h>
 #include <msp/time/units.h>
@@ -49,6 +50,10 @@ Engineer::Engineer(int argc, char **argv):
        window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &Engineer::exit), 0));
 
        root = new GLtk::Root(ui_res, &window, &keyboard, &mouse);
+       GLtk::Layout *root_layout = new GLtk::Layout;
+       root->set_layout(root_layout);
+       root_layout->set_margin(GLtk::Sides());
+       root_arrangement = new GLtk::FloatingArrangement(*root_layout);
        mouse.signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &Engineer::button_press), false));
        mouse.signal_axis_motion.connect(sigc::bind_return(sigc::mem_fun(this, &Engineer::axis_motion), false));
        root->set_visible(true);
@@ -123,6 +128,7 @@ Engineer::~Engineer()
        }
 
        delete overlay;
+       delete root_arrangement;
        delete root;
 
        delete server;