I had this following code pull from one of the tutorials on line. When I use gtk+-2.0, the following code works fine.
But when I try compile with gtk+-3.0, the code gives this error:
signal 'expose-event' is invalid for instance of type 'GtkWindow'
So I try to do the following, but still doesn't help. And it gives another error:
signal 'expose-event' is invalid for instance of type 'GdkX11Window'
gtk_widget_realize(window);
GdkWindow *gdkwin = gtk_widget_get_window(Gwindow);
int main(int argc, char *argv[])
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(window, "expose-event",
G_CALLBACK (on_expose_event), NULL);
g_signal_connect(window, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(window), 300, 230);
gtk_widget_set_app_paintable(window, TRUE);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
main()
? – Gayn