New file: builder-wrapper.h and builder-wrapper.c
[pspp-builds.git] / src / ui / gui / t-test-options.c
index 224b022caa670cc5d52710af4f2ae562d92e9031..1caac9c0f7d27224adfa7c8f63c3c3f3046b2b08 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2007  Free Software Foundation
+   Copyright (C) 2007, 2012  Free Software Foundation
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #include "psppire-dialog.h"
 #include <gl/xalloc.h>
+#include "builder-wrapper.h"
 #include "helper.h"
 #include "t-test-options.h"
 
 #include "widget-io.h"
+#include "psppire-scanf.h"
 
 #include <gettext.h>
 #define _(msgid) gettext (msgid)
@@ -49,23 +51,25 @@ struct tt_options_dialog
   gdouble confidence_interval;
   gboolean non_default_options;
   enum exclude_mode excl;
+  GtkBuilder *xml;
 };
 
 struct tt_options_dialog *
-tt_options_dialog_create (GtkBuilder *xml, GtkWindow *parent)
+tt_options_dialog_create (GtkWindow *parent)
 {
   struct tt_options_dialog *tto = xmalloc (sizeof (*tto));
 
+  tto->xml = builder_new ("t-test.ui");
+
   tto->confidence =
-    widget_scanf (_("Confidence Interval: %2d %%"),
-                 &tto->conf_percent);
+    psppire_scanf_new (_("Confidence Interval: %2d %%"), &tto->conf_percent);
 
-  tto->dialog = get_widget_assert (xml, "options-dialog");
+  tto->dialog = get_widget_assert (tto->xml, "options-dialog");
 
-  tto->box =   get_widget_assert (xml, "vbox1");
+  tto->box =   get_widget_assert (tto->xml, "vbox1");
 
-  tto->analysis = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton1"));
-  tto->listwise = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton2"));
+  tto->analysis = GTK_TOGGLE_BUTTON (get_widget_assert (tto->xml, "radiobutton1"));
+  tto->listwise = GTK_TOGGLE_BUTTON (get_widget_assert (tto->xml, "radiobutton2"));
 
   gtk_widget_show (tto->confidence);
 
@@ -84,6 +88,7 @@ void
 tt_options_dialog_destroy (struct tt_options_dialog *tto)
 {
   gtk_container_remove (GTK_CONTAINER (tto->box), tto->confidence);
+  g_object_unref (tto->xml);
   g_free (tto);
 }
 
@@ -115,7 +120,7 @@ tt_options_dialog_run (struct tt_options_dialog *tto)
 }
 
 void
-tt_options_dialog_append_syntax (struct tt_options_dialog *tto, GString *str)
+tt_options_dialog_append_syntax (const struct tt_options_dialog *tto, GString *str)
 {
   g_string_append (str, "\t/MISSING=");