summaryrefslogtreecommitdiff
path: root/src/gtk_win_main.cc
blob: 8997b560e6b758d820080f852bd90fc35616c39a (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
#include "gtk_win_main.h"


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;
	set_events(mask);

	show_all();
}

GTKWinMain::~GTKWinMain()
{}

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