g_signal_connect problem



Hi.
How to connect class member function as callback function in GTK2.x
I use GTKmm to create GUI.
I've got class window1 and member function:
void handle_signal_selection_stopped (GtkDatabox * box,
                                 GtkDataboxCoord * marked,
                                 GtkDataboxCoord * select);

I try to connect this function like this:
g_signal_connect (G_OBJECT (drawbox2), "gtk_databox_selection_stopped",
                     G_CALLBACK (handle_signal_selection_stopped), NULL);
but I've got an error:
"no matches converting function  `handle_signal_selection_stopped` to type 
void (*)();
candidates are:void window1::handle_signal_selection_stopped(....""

I've allso tried  :
g_signal_connect (G_OBJECT (drawbox2), "gtk_databox_selection_stopped",
                     G_CALLBACK (&window1::handle_signal_selection_stopped), NULL);

but it  gives error:"converting from void (window1::*)(GtkDatabox* ....) to 
void(*)();"

When I declare function handle_signal_selection_stopped as global function 
it's compile and work correctly.

How to solve this problem ??
I need class member function to use member values etc...


--
Gregory




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