I have a struct that looks like the one below
struct dc_callback
{
int
my_configure_event(
GtkWidget *widget,
GdkEventConfigure *event,
struct LoadData *myData)
{
...others
return TRUE;
}
//Parametrized Constructor
int
my_draw(
GtkWidget *widget,
cairo_t *cr,
struct LoadData *myData)
{
...others
return TRUE;
}
};
It has two parametrized member function that I intend to call from g_signal_connect
for some nth time.
main(){
int i;
dc_callback dc_callback_instance[nth];
for(i=0;i<nth;i++){
g_signal_connect(widget_list[i],"draw",G_CALLBACK(dc_callback_instance[i].my_draw),myData);
g_signal_connect(widget_list[i],"configure-event",G_CALLBACK(dc_callback_instance[i].my_configure_event),myData);
}
}
However, during compile time, I get an error regarding invalid use of member function int dc_callback::my_draw(args)
. It ask me to add ()
but that could not be done since the G_CALLBACK accepts function name without its attached argument.
How to I accomplish this?