From 2f9d0367cd872d1c50b889365793abc19d9e8f79 Mon Sep 17 00:00:00 2001 From: tchernobog Date: Thu, 26 Jan 2006 23:06:18 +0000 Subject: [PATCH] - Show an example of the use of a signal, and basic packing, for the developer git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@217 3ecf2c5c-341e-0410-92b4-d18e462d057c --- src/gtkgui/mainwindow.cc | 17 ++++++++++++++++- src/gtkgui/startgui.cc | 3 +-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/gtkgui/mainwindow.cc b/src/gtkgui/mainwindow.cc index ad5aa48..c303765 100644 --- a/src/gtkgui/mainwindow.cc +++ b/src/gtkgui/mainwindow.cc @@ -23,9 +23,24 @@ #include "mainwindow.hh" +#include +#include #include +#include #include -MainWindow::MainWindow() {} +MainWindow::MainWindow() { + set_title(PACKAGE_STRING); + set_default_size(800, 600); + + Gtk::Box* mainbox = manage(new Gtk::VBox()); + add(*mainbox); + + Gtk::Button* bt_exit = manage(new Gtk::Button(_("Exit"))); + bt_exit->signal_clicked().connect(sigc::ptr_fun(Gtk::Main::quit)); + mainbox->pack_start(*bt_exit); + + show_all_children(); +} MainWindow::~MainWindow() {} diff --git a/src/gtkgui/startgui.cc b/src/gtkgui/startgui.cc index 035870f..41c619c 100644 --- a/src/gtkgui/startgui.cc +++ b/src/gtkgui/startgui.cc @@ -25,12 +25,11 @@ #include "startgui.hh" #include -#include void DLLEXPORT start_gui(int argc, char** argv) { Gtk::Main gtk_main(argc,argv); - Gtk::Window main_window; + MainWindow main_window; Gtk::Main::run(main_window); }