- 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
This commit is contained in:
tchernobog 2006-01-26 23:06:18 +00:00
parent 692fc55553
commit 2f9d0367cd
2 changed files with 17 additions and 3 deletions

View File

@ -23,9 +23,24 @@
#include "mainwindow.hh"
#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/main.h>
#include <gtkmm/menubar.h>
#include <gtkmm/window.h>
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() {}

View File

@ -25,12 +25,11 @@
#include "startgui.hh"
#include <gtkmm/main.h>
#include <gtkmm/window.h>
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);
}