On Tue, Jul 15, 2008 at 12:09 PM, Marco Rocco <[EMAIL PROTECTED]> wrote:
> Hello, this is my first post on this mailing list, now i do my request: > can i use g_signal_connect in a method of my class, using as c_handler a > private function of class? ...and if i can, how i can do ? > > If you use C++ and plain GTK, supposing you are initializing your callback in the you should do something like this: class MyClass { GtkWidget *mywidget_; static void handle_click_cbk(GtkWidget *mywidget_, MyClass *data) { data->handle_click(); } void handle_click(); // your real callback public: MyClass() { mywidget_ = gtk_button_new(); g_signal_connect(mywidget_, "clicked", GCallback(handle_click_cbk), this); } }; -- Bye, Gabry _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list