GTK Signals (Cont.) In the example above, our callback will cause the GTK application to send itself a 'destroy' event. Here is how we handle this event: /* Here we connect the "destroy" event to a signal handler. * This event occurs when we call gtk_widget_destroy() on * the window, or if we return FALSE in the "delete_event" * callback. */ gtk_signal_connect(GTK_OBJECT (main_window), "destroy", GTK_SIGNAL_FUNC (exit_cb), NULL); And the callback itself is defined like this: /* exit the application. */ void exit_cb(GtkWidget *widget, gpointer data) { gtk_main_quit(); }