summaryrefslogtreecommitdiffhomepage
path: root/mixgtk
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2004-07-02 00:06:26 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2004-07-02 00:06:26 +0000
commit885fda6955ca7180a4a18d2ee314b7f94983a9dc (patch)
tree9fc25390d2c9a6efff6bb70b666a92bea2c4a8b6 /mixgtk
parent4b3458f790248699645ee44f5097f07f106ba445 (diff)
downloadmdk-885fda6955ca7180a4a18d2ee314b7f94983a9dc.tar.gz
mdk-885fda6955ca7180a4a18d2ee314b7f94983a9dc.tar.bz2
(log_command_): correctly place cursor before insertion.
Diffstat (limited to 'mixgtk')
-rw-r--r--mixgtk/mixgtk_cmd_dispatcher.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mixgtk/mixgtk_cmd_dispatcher.c b/mixgtk/mixgtk_cmd_dispatcher.c
index 98782ce..a87913b 100644
--- a/mixgtk/mixgtk_cmd_dispatcher.c
+++ b/mixgtk/mixgtk_cmd_dispatcher.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixgtk_cmd_dispatcher.c :
* Implementation of the functions declared in mixgtk_cmd_dispatcher.h
* ------------------------------------------------------------------
- * $Id: mixgtk_cmd_dispatcher.c,v 1.17 2004/06/24 01:40:47 jao Exp $
+ * $Id: mixgtk_cmd_dispatcher.c,v 1.18 2004/07/02 00:06:26 jao Exp $
* ------------------------------------------------------------------
* Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
*
@@ -76,7 +76,10 @@ static void
log_command_ (mixgtk_dispatch_data_t *dis, const gchar *cmd)
{
GtkTextBuffer *buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dis->log));
+ GtkTextIter end;
+ gtk_text_buffer_get_end_iter (buf, &end);
+ gtk_text_buffer_place_cursor (buf, &end);
gtk_text_buffer_insert_at_cursor (buf, "MIX> ", -1);
gtk_text_buffer_insert_at_cursor (buf, cmd, -1);
gtk_text_buffer_insert_at_cursor (buf, "\n", -1);
@@ -96,8 +99,12 @@ flush_log_ (mixgtk_dispatch_data_t *dis)
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dis->log));
GtkTextMark *mark;
+ GtkTextIter end;
ssize_t k;
+ gtk_text_buffer_get_end_iter (buffer, &end);
+ gtk_text_buffer_place_cursor (buffer, &end);
+
fflush (dis->out);
while ((k = read (dis->fildes[0], BUFFER, BLKSIZE)) != 0)
{