diff options
Diffstat (limited to 'src/gtk_win_main.cc')
-rw-r--r-- | src/gtk_win_main.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gtk_win_main.cc b/src/gtk_win_main.cc new file mode 100644 index 0000000..eca9df0 --- /dev/null +++ b/src/gtk_win_main.cc @@ -0,0 +1,28 @@ +#include "gtk_win_main.h" + + +GTKWinMain::GTKWinMain(MyGTKGLScene &glScene) + : m_VBox(false, 0), m_ButtonQuit("Quit"), m_GLScene(glScene) +{ + set_title(WIN_MAIN_TITLE); + set_reallocate_redraws(true); // Get automatically redrawn if any of their children changed allocation. + + // Add components to the window + add(m_VBox); + m_VBox.pack_start(m_GLScene); + m_VBox.pack_start(m_ButtonQuit, Gtk::PACK_SHRINK, 0); + + // Link signal handlers on events + m_ButtonQuit.signal_clicked().connect( sigc::mem_fun(*this, >KWinMain::on_button_quit_clicked) ); + + show_all(); +} + +GTKWinMain::~GTKWinMain() +{} + +void GTKWinMain::on_button_quit_clicked() +{ + Gtk::Main::quit(); +} + |