Re: class problem



Martin Oberzalek <oberzalek@chello.at> writes:

> I have this function:
> 
> void PR_Assistent::quitt_app( gpointer callback_data,
> guint                                            callback_action,
> GtkWidget *widget )
> {
>   gtk_main_quit();
> }
> 

For delete_event your function should be:
gint quitt_app(GtkWidget* window, GdkEventAny* event, gpointer data)
{

  return FALSE;
}
 
> but I always get this Compiler error:
> assistent.hh:126: no matches converting function `quitt_app' to type
> `void (*)(...)'
> assistent.hh:96: candidates are: void PR_Assistent::quitt_app(void *,
> unsigned int, GtkWidget *)
> 
> So is it possible to use a class function as a "GtkSignalFunc" and how.
> 

Is quit_app() static or member? If it's a method then it won't
work. If it's static then it should, but technically isn't guaranteed
to; you may need to put it outside the class and declare it extern
"C".

Havoc



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