diff options
-rw-r--r-- | mixgtk/mixgtk_device.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/mixgtk/mixgtk_device.c b/mixgtk/mixgtk_device.c index 885c19c..1b3a78a 100644 --- a/mixgtk/mixgtk_device.c +++ b/mixgtk/mixgtk_device.c @@ -1,7 +1,7 @@ /* -*-c-*- ---------------- mixgtk_device.c : * actual types for mixgtk devices * ------------------------------------------------------------------ - * $Id: mixgtk_device.c,v 1.23 2004/06/30 14:07:53 jao Exp $ + * $Id: mixgtk_device.c,v 1.24 2004/07/02 00:08:28 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. * @@ -90,7 +90,11 @@ write_char_ (struct mixgtk_device_t *dev, const mix_word_t *block) { enum {MAX_BLOCK = 16, BUFF_SIZE = MAX_BLOCK * 5 + 2}; static gchar BUFFER[BUFF_SIZE]; + guint k, j; + GtkTextIter end; + GtkTextBuffer *buffer; + GtkTextMark *mark; for (k = 0; k < SIZES_[dev->device.type]; k++) for (j = 1; j < 6; j++) @@ -102,9 +106,13 @@ write_char_ (struct mixgtk_device_t *dev, const mix_word_t *block) BUFFER[5 * k] = '\n'; BUFFER[5 * k + 1] = '\0'; - gtk_text_buffer_insert_at_cursor - (gtk_text_view_get_buffer (GTK_TEXT_VIEW (dev->widget)), BUFFER, -1); - + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dev->widget)); + gtk_text_buffer_get_end_iter (buffer, &end); + gtk_text_buffer_place_cursor (buffer, &end); + gtk_text_buffer_insert_at_cursor (buffer, BUFFER, -1); + mark = gtk_text_buffer_get_insert (buffer); + gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (dev->widget), mark, 0, + TRUE, 0, 0); } static const gchar * |