Only if the member function is static. Calling a non-static member
function requires two addresses: the instance address and the function
address. Whether its public or private doesn't matter because access to
function pointers is not checked by compilers. I frequently do
something like this:
class SomeClass
{
...
private:
...
static void staticCb(..., gpointer inInstance) {
SomeClass* instance = (SomeClass*)inInstance;
instance->callback(...);
}
void callback(...) {
...
}
...
void someFunc() {
...
g_signal_connect(..., G_CALLBACK(&staticCb), this);
...
}
...
};
-Anthony Vallone
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Marco Rocco
Sent: Tuesday, July 15, 2008 6:04 AM
To: [email protected]
Subject: Using g_signal_connect in class
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 ?
_______________________________________________
gtk-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-list
_______________________________________________
gtk-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-list