Re: Using g_signal_connect in class
- From: "Gabriele Greco" <gabriele greco darts it>
- To: "Marco Rocco" <mr85mr gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Using g_signal_connect in class
- Date: Tue, 15 Jul 2008 12:36:18 +0200
On Tue, Jul 15, 2008 at 12:09 PM, Marco Rocco <mr85mr gmail com> 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]