+static void
+psppire_var_sheet_realize (GtkWidget *w)
+{
+ PsppireVarSheet *vs = PSPPIRE_VAR_SHEET (w);
+
+ GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (vs));
+
+ vs->val_labs_dialog = val_labs_dialog_create (GTK_WINDOW (toplevel),
+ PSPPIRE_VAR_STORE (psppire_sheet_get_model (PSPPIRE_SHEET (vs))));
+
+ vs->missing_val_dialog = missing_val_dialog_create (GTK_WINDOW (toplevel));
+ vs->var_type_dialog = var_type_dialog_create (GTK_WINDOW (toplevel));
+
+ /* Chain up to the parent class */
+ GTK_WIDGET_CLASS (parent_class)->realize (w);
+}
+
+static void
+psppire_var_sheet_unrealize (GtkWidget *w)
+{
+ PsppireVarSheet *vs = PSPPIRE_VAR_SHEET (w);
+
+ g_free (vs->val_labs_dialog);
+ g_free (vs->missing_val_dialog);
+ g_free (vs->var_type_dialog);
+
+ /* Chain up to the parent class */
+ GTK_WIDGET_CLASS (parent_class)->unrealize (w);
+}
+