design of classes of widgets in GTK...
Hello all,
I'm trying to make a class for a standard window. For some reason there is a problem with g_signal_connect and the G_CALLBACK used within. How can I use a class-member to destroy a window for example... These are the code snippets :
class c_window
c_window(char *title, short border)
{
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window),title);
g_signal_connect (window, "destroy", G_CALLBACK(destroy), NULL);
vbox = gtk_vbox_new(FALSE,0);
gtk_container_set_border_width(GTK_CONTAINER(vbox),border);
gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_widget_show(vbox);
gtk_widget_set_size_request(window,-1,-1);
gtk_widget_show(window);
};
void destroy(GtkWidget *window, gpointer data)
{
{
gtk_widget_destroy(window);
};
The compiler says "invalid use of member".
Any ideas?
Greetings,
Ronald
|