+2007-09-26 John Darrington <john@darrington.wattle.id.au>
+
+ * output-viewer.c output-viewer.h psppire.c: (closes patch #6210)
+ Changed width and length parameters of output driver to
+ "auto". Changed default width and length to be something
+ acceptable to the ascii driver. (reload_viewer) Dynamically
+ allocate the line buffer so that it matches the width of the output.
+
2007-09-24 Ben Pfaff <blp@gnu.org>
* message-dialog.c (popup_message): Refer to files that contain
static struct output_viewer *the_output_viewer = NULL;
-int viewer_length = -1;
-int viewer_width = -1;
+int viewer_length = 16;
+int viewer_width = 59;
/* Callback for the "delete" action (clicking the x on the top right
hand corner of the window) */
reload_viewer (struct output_viewer *ov)
{
GtkTextIter end_iter;
- char line[OUTPUT_LINE_WIDTH];
+ static char *line = NULL;
GtkTextMark *mark ;
gboolean chars_inserted = FALSE;
}
}
+ line = xrealloc (line, sizeof (char) * (viewer_width + 1));
+
gtk_text_buffer_get_end_iter (ov->buffer, &end_iter);
mark = gtk_text_buffer_create_mark (ov->buffer, NULL, &end_iter, TRUE);
/* Read in the next lot of text */
- while (fgets (line, OUTPUT_LINE_WIDTH, ov->fp) != NULL)
+ while (fgets (line, viewer_width + 1, ov->fp) != NULL)
{
chars_inserted = TRUE;
gtk_text_buffer_insert (ov->buffer, &end_iter, line, -1);
#define OUTPUT_FILE_NAME "psppire.txt"
-/* Make sure these two agree !! */
-#define OUTPUT_LINE_WIDTH 80
-#define OUTPUT_LINE_WIDTH_str "80"
-
-
#endif
outp_configure_driver_line (
ss_cstr ("gui:ascii:screen:squeeze=on headers=off top-margin=0 "
- "bottom-margin=0 paginate=off length=50 "
- "width=" OUTPUT_LINE_WIDTH_str " emphasis=none "
+ "bottom-margin=0 paginate=off length=auto width=auto "
+ "emphasis=none "
"output-file=\"" OUTPUT_FILE_NAME "\" append=yes"));
unlink (OUTPUT_FILE_NAME);