diff options
author | Akira TAGOH <akira@tagoh.org> | 2006-06-15 18:12:08 +0000 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2006-06-15 18:12:08 +0000 |
commit | ec962ae9374aa6613146b960d87862ce8e150f33 (patch) | |
tree | 953b21a624f4996168487463fd48d1a2153b2088 /src | |
parent | ab69af1c88fdb42a055ac4dffcc1acfb2cb434ad (diff) |
(_hgspy_file_write_cb): scroll up to the latest output.
(main): only wait for finalize process when VM is running.
Diffstat (limited to 'src')
-rw-r--r-- | src/hgspy.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/hgspy.c b/src/hgspy.c index 399e4d1..afcffae 100644 --- a/src/hgspy.c +++ b/src/hgspy.c @@ -151,13 +151,16 @@ _hgspy_file_write_cb(gpointer user_data, HgSpy *spy = user_data; GtkTextBuffer *textbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW (spy->textview)); GtkTextIter iter; + gdouble val; /* to be thread-safe */ gdk_threads_enter(); gtk_text_buffer_get_end_iter(textbuf, &iter); gtk_text_buffer_insert(textbuf, &iter, buffer, size * n); - gtk_text_buffer_place_cursor(textbuf, &iter); + val = GTK_TEXT_VIEW (spy->textview)->vadjustment->upper; + gtk_adjustment_set_value(GTK_TEXT_VIEW (spy->textview)->vadjustment, + val); gdk_flush(); gdk_threads_leave(); @@ -811,9 +814,11 @@ main(int argc, gtk_main(); gdk_threads_leave(); - spy->destroyed = TRUE; - while (spy->destroyed) - sleep(1); + if (spy->vm) { + spy->destroyed = TRUE; + while (spy->destroyed) + sleep(1); + } /* finalize */ g_module_close(module); |