#include <gtkmm.h>
#include <goocanvasmm.h>
#include <sigc++/sigc++.h>

bool ShowDialog( const Glib::RefPtr<Goocanvas::Item>& item, GdkEventButton* ev)
{
    enum { OK };
    Gtk::Dialog dialog;
    dialog.add_button( Gtk::Stock::OK, OK);
    dialog.show_all_children();
    dialog.run();
    return false;
}

int main(int argc, char* argv[])
{
    Gtk::Main app(&argc, &argv);
    Goocanvas::init("example", "0.1", argc, argv);
    Gtk::Window win;

    Goocanvas::Canvas m_canvas;
    m_canvas.set_size_request(640, 480);
    m_canvas.set_bounds(0, 0, 800, 800);
    Glib::RefPtr<Goocanvas::Item> root = m_canvas.get_root_item();

    Glib::RefPtr<Goocanvas::Ellipse> outer = Goocanvas::Ellipse::create( 100,100,20,20);
    outer->property_line_width() = 5;
    outer->property_stroke_color() = "red";
    outer->property_fill_color()="blue";
    root->add_child( outer );

    sigc::connection conn2= outer->signal_button_press_event().connect( sigc::ptr_fun(&ShowDialog));

    win.add(m_canvas);
    win.show_all_children();

    Gtk::Main::run(win);
    return 0;
}
