Re: Signal with C++



> 
> Why this program cause errors at signal connect ?
> 
> 	void Close(GtkWidget *widget,
>                    gpointer client_data)
          ^^^^^^^^^^^^^^^
> 
> cc-1168 CC: ERROR File = teste.C, Line = 33
>   The indicated type conversion is invalid.

>  GTK_SIGNAL_FUNC(Close),
>  ^
> 1 error detected in the compilation of "teste.C".

A GtkSignalFunc must be a pointer to a static function or c style
function (C only if you want to be really picky about the standard.)

Your Close function is type void CWin::Close(GtkWidget*,gpointer)
And thus it can't possibly make that conversion.  Especially since
sizeof(void (*)() ) != sizeof (void (::*)() ).  Thus Close
must be static or you need to use a different system. 

Consider going a using a binding like gtk-- or perhaps sugar.
Sugar is just C with classes (no inheritance) and Gtk-- is 
the whole ball of wax (anything C++ can do.)

--Karl



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