static GtkWidget * status_label;
static void open_slice_window (void);
static void close_slice_window (void);
+static gboolean slice_window_delete_event (GtkWidget *window, GdkEvent *event, gpointer *data);
static gchar * gpollfds_string (GSList * gpollfds);
void
GtkWidget * vbox = gtk_vbox_new (FALSE, 5);
status_label = gtk_label_new ("Channels:");
slice_label = gtk_label_new ("Scheme time-slice: 0");
+ g_signal_connect (slice_window, "delete_event",
+ G_CALLBACK (slice_window_delete_event), NULL);
gtk_container_add (GTK_CONTAINER (slice_window), vbox);
gtk_box_pack_start (GTK_BOX (vbox), status_label, FALSE, FALSE, 2);
gtk_box_pack_end (GTK_BOX (vbox), slice_label, FALSE, FALSE, 2);
{
gtk_widget_destroy (GTK_WIDGET (slice_window));
slice_window = NULL;
+ gtk_widget_destroy (GTK_WIDGET (status_label));
status_label = NULL;
+ gtk_widget_destroy (GTK_WIDGET (slice_label));
slice_label = NULL;
}
+static gboolean
+slice_window_delete_event (GtkWidget *window, GdkEvent *event, gpointer *data)
+{
+ slice_window = NULL;
+ gtk_widget_destroy (GTK_WIDGET (status_label));
+ status_label = NULL;
+ gtk_widget_destroy (GTK_WIDGET (slice_label));
+ slice_label = NULL;
+ return (FALSE); /* not handled here */
+}
+
gboolean
gtk_time_slice_window_p (void)
{