// Needed for each application to initialize GTK+ and GTKmm
#include <gtkmm/Main.h>   
// Needed Buttons
#include <gtkmm/Button.h> 
// Needed for the Window ;)
#include <gtkmm/Window.h> 

// Just inherit from Gtk::Window
struct MyWindow : public Gtk::Window
{
    MyWindow();
    Gtk::Button m_quit_button;     // We just want a button
    void on_button_quit_clicked(); // this should be executed on a button click
};

MyWindow::MyWindow()
: m_quit_button("Quit") // Setting the caption of the button
{
    set_size_request( 200 , 100 ); // Setting the window size

    set_title("Hello World"); // Setting the window caption 

    add(m_quit_button);  // add the button to the window

    // set the button click signal handler
    m_quit_button.signal_clicked()
	    .connect(sigc::mem_fun(*this,&MyWindow::on_button_quit_clicked));

    show_all(); // Shows all widgets 
}

// Signal
void MyWindow::on_button_quit_clicked()
{
    hide();// closes the window and quits
}


int main(int argc, char**argv)
{
    // To guarantee standard GTK+ commandline parameters the 
    // argument variables are passed for the intialization
    Gtk::Main main_obj(argc,argv);

    MyWindow window_obj;      // An instance of our inherited window

    main_obj.run(window_obj); // starting the application

    return EXIT_SUCCESS;      // return 0
}
