Gtk::Window and signal_button_release_event



Hello List,

why does the following not work? on_window_clicked is not called
when I click into the window.

Thanks and best regards
Christian


#include <iostream>
#include <gtkmm.h>

bool on_window_clicked(GdkEventButton *b)
{
        std::cout << "Window clicked\n";
        return true;
}

int main(int argc, char **argv)
{
        Gtk::Window *w;

        Gtk::Main gtk_main(argc,argv);

        w = new Gtk::Window();
        w->show();
        w->signal_button_release_event().connect(sigc::ptr_fun(on_window_clicked));

        gtk_main.run();
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]