Logistical Regression Dialog: Automatically mark appropriate variables as categorical
[pspp] / src / ui / gui / spreadsheet-test.c
index bec577821a68076fc20831580b00ed1bf3739677..b70227008331377db9dd626fbd5582bbf4164cdd 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2013  Free Software Foundation
+   Copyright (C) 2013, 2014  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
@@ -19,6 +19,7 @@
 
 #include <config.h>
 
+#include <float.h>
 #include <gtk/gtk.h>
 
 #include "psppire-spreadsheet-model.h"
@@ -78,7 +79,7 @@ on_clicked (GtkButton *button, struct xxx *stuff)
        const int width = caseproto_get_width (proto, i);
        const union value *val = case_data_idx (c, i);
        if (0 == width)
-         printf ("%g ", val->f);
+         printf ("%.*g ", DBL_DIG + 1, val->f);
        else
          {
            char *ss = xzalloc (width + 1);
@@ -139,8 +140,8 @@ main (int argc, char *argv[] )
 
   tm = psppire_spreadsheet_model_new (stuff.sp);
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  hbox = gtk_hbox_new (FALSE, 5);
-  vbox = gtk_vbox_new (FALSE, 5);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
 
   button = gtk_button_new_with_label ("Test reader");
   g_signal_connect (button, "clicked", G_CALLBACK (on_clicked), &stuff);
@@ -191,7 +192,7 @@ main (int argc, char *argv[] )
 
   gtk_main ();
 
-  spreadsheet_destroy (stuff.sp);
+  spreadsheet_unref (stuff.sp);
 
   return 0;
 }