output: Include command names in titles in GUI output.
[pspp] / src / ui / gui / psppire-output-window.c
index 510d1c9e0c7e51836a1d9d06cf202699a18ce362..542e7b302c725f4caef14673e650d276382b7eeb 100644 (file)
@@ -129,7 +129,8 @@ expose_event_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data)
                                           tab_r (t), tab_t (t), tab_b (t));
 
   entity->class->title (rendering, 0, 0,
-                        entity->table_num, entity->subtable_num);
+                        entity->table_num, entity->subtable_num,
+                        entity->command_name);
   entity->class->render (rendering, tab_l (t), tab_t (t),
                          tab_nc (t) - tab_r (t),
                          tab_nr (t) - tab_b (t));
@@ -146,7 +147,7 @@ psppire_output_submit (struct outp_driver *this, struct som_entity *entity)
   if (the_output_viewer == NULL)
     {
       the_output_viewer = PSPPIRE_OUTPUT_WINDOW (psppire_output_window_new ());
-      gtk_widget_show_now (GTK_WIDGET (the_output_viewer));
+      gtk_widget_show_all (GTK_WIDGET (the_output_viewer));
     }
 
   if (entity->type == SOM_TABLE)
@@ -165,8 +166,10 @@ psppire_output_submit (struct outp_driver *this, struct som_entity *entity)
       entity->class->area (rendering, &tw, &th);
 
       drawing_area = gtk_drawing_area_new ();
+      gtk_widget_modify_bg (GTK_WIDGET (drawing_area), GTK_STATE_NORMAL,
+                            &gtk_widget_get_style (drawing_area)->base[GTK_STATE_NORMAL]);
       g_object_set_data (G_OBJECT (drawing_area),
-                         "entity", xmemdup (entity, sizeof *entity));
+                         "entity", som_entity_clone (entity));
       gtk_widget_set_size_request (drawing_area, tw / 1024, th / 1024);
       gtk_layout_put (the_output_viewer->output, drawing_area,
                       0, the_output_viewer->y);
@@ -178,7 +181,12 @@ psppire_output_submit (struct outp_driver *this, struct som_entity *entity)
       driver->class->close_driver (driver);
       outp_free_driver (driver);
 
+      if (tw / 1024 > the_output_viewer->max_width)
+        the_output_viewer->max_width = tw / 1024;
       the_output_viewer->y += th / 1024;
+
+      gtk_layout_set_size (the_output_viewer->output,
+                           the_output_viewer->max_width, the_output_viewer->y);
     }
 
   gtk_window_set_urgency_hint (GTK_WINDOW (the_output_viewer), TRUE);
@@ -244,6 +252,9 @@ psppire_output_window_init (PsppireOutputWindow *window)
   window->output = GTK_LAYOUT (get_widget_assert (xml, "output"));
   window->y = 0;
 
+  gtk_widget_modify_bg (GTK_WIDGET (window->output), GTK_STATE_NORMAL,
+                        &gtk_widget_get_style (GTK_WIDGET (window->output))->base[GTK_STATE_NORMAL]);
+
   connect_help (xml);
 
   g_signal_connect (window,