diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/action.c | 19 |
3 files changed, 21 insertions, 8 deletions
@@ -1,5 +1,10 @@ 2005-04-11 + * src/action.c: catch_output(): correctly select the insert text + (fix invalid iterator warnings). + +2005-04-11 + * src/gtkutils.[ch] src/folderview.[ch]: implemented message-to-folder DnD. Auto-expand and auto-scroll are also implemented. diff --git a/ChangeLog.ja b/ChangeLog.ja index 4bd6c235..f02c3cb3 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2005-04-11 + * src/action.c: catch_output(): 挿入されたテキストを正しく選択する + ようにした(不正なイテレータの警告を修正)。 + +2005-04-11 + * src/gtkutils.[ch] src/folderview.[ch]: メッセージからフォルダへの DnD を実装。 自動展開と自動スクロールも実装。 diff --git a/src/action.c b/src/action.c index 25fe2f26..3949770f 100644 --- a/src/action.c +++ b/src/action.c @@ -1213,12 +1213,13 @@ static void catch_output(gpointer data, gint source, GdkInputCondition cond) GtkTextView *text = GTK_TEXT_VIEW(child_info->children->msg_text); GtkTextBuffer *textbuf = gtk_text_view_get_buffer(text); - GtkTextIter iter1, iter2; + GtkTextIter iter; GtkTextMark *mark; + gint ins_pos; mark = gtk_text_buffer_get_insert(textbuf); - gtk_text_buffer_get_iter_at_mark(textbuf, &iter1, mark); - gtk_text_buffer_get_iter_at_mark(textbuf, &iter2, mark); + gtk_text_buffer_get_iter_at_mark(textbuf, &iter, mark); + ins_pos = gtk_text_iter_get_offset(&iter); while (TRUE) { gsize bytes_read = 0, bytes_written = 0; @@ -1232,17 +1233,19 @@ static void catch_output(gpointer data, gint source, GdkInputCondition cond) (buf, c, &bytes_read, &bytes_written, NULL); if (ret_str && bytes_written > 0) { gtk_text_buffer_insert - (textbuf, &iter2, ret_str, + (textbuf, &iter, ret_str, bytes_written); g_free(ret_str); } else - gtk_text_buffer_insert(textbuf, &iter2, buf, c); + gtk_text_buffer_insert(textbuf, &iter, buf, c); } if (child_info->children->is_selection) { - gtk_text_buffer_place_cursor(textbuf, &iter1); - gtk_text_buffer_move_mark_by_name - (textbuf, "selection_bound", &iter2); + GtkTextIter ins; + + gtk_text_buffer_get_iter_at_offset + (textbuf, &ins, ins_pos); + gtk_text_buffer_select_range(textbuf, &ins, &iter); } } else { c = read(source, buf, sizeof(buf) - 1); |