summaryrefslogtreecommitdiff
path: root/src/gtk_win_main.cpp
blob: bf070cacbe8d774d54cf3b1a50ab853a1b3ad8dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "gtk_win_main.hpp"


GTKWinMain::GTKWinMain(MyGTKGLSceneWidget &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, &GTKWinMain::on_button_quit_clicked) );
	Gdk::EventMask mask = Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_MOTION_MASK \
			      | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK \
			      | Gdk::SCROLL_MASK ;
	set_events(mask);

	show_all();
}

GTKWinMain::~GTKWinMain()
{}

void GTKWinMain::on_button_quit_clicked()
{
	Gtk::Main::quit();
}