+static gboolean results_window_delete(GtkWidget *w, gpointer data)
+{
+ struct gui *ui = (struct gui *) data;
+
+ gtk_widget_destroy(w);
+ ui->results_window = NULL;
+ ui->results_notebook = NULL;
+ return TRUE;
+}
+
+static GtkWidget *get_results_window(struct gui *ui)
+{
+ GtkWidget *win, *notebook;
+
+ if (ui->results_window)
+ return ui->results_notebook;
+
+ win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title(GTK_WINDOW(win), "Results");
+ g_signal_connect(win, "delete-event", G_CALLBACK(results_window_delete), ui);
+ g_signal_connect(win, "destroy", G_CALLBACK(results_window_delete), ui);
+
+ notebook = gtk_notebook_new();
+ gtk_container_add(GTK_CONTAINER(win), notebook);
+
+ ui->results_window = win;
+ ui->results_notebook = notebook;
+ return ui->results_notebook;
+}
+