[gtk+] a11y: Emit text-changed signals when the text-buffer changes



commit ce0675f1fb2582717793ec29b1787039dfbf8437
Author: Benjamin Otte <otte redhat com>
Date:   Tue Feb 26 16:17:33 2013 +0100

    a11y: Emit text-changed signals when the text-buffer changes

 gtk/a11y/gtktextviewaccessible.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c
index 9e59b8f..ca07161 100644
--- a/gtk/a11y/gtktextviewaccessible.c
+++ b/gtk/a11y/gtktextviewaccessible.c
@@ -117,6 +117,11 @@ gtk_text_view_accessible_change_buffer (GtkTextViewAccessible *accessible,
   if (old_buffer)
     {
       g_signal_handlers_disconnect_matched (old_buffer, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, accessible);
+
+      g_signal_emit_by_name (accessible,
+                             "text-changed::delete",
+                             0,
+                             gtk_text_buffer_get_char_count (old_buffer));
     }
 
   if (new_buffer)
@@ -124,6 +129,11 @@ gtk_text_view_accessible_change_buffer (GtkTextViewAccessible *accessible,
       g_signal_connect_after (new_buffer, "insert-text", G_CALLBACK (insert_text_cb), accessible);
       g_signal_connect (new_buffer, "delete-range", G_CALLBACK (delete_range_cb), accessible);
       g_signal_connect_after (new_buffer, "mark-set", G_CALLBACK (mark_set_cb), accessible);
+
+      g_signal_emit_by_name (accessible,
+                             "text-changed::insert",
+                             0,
+                             gtk_text_buffer_get_char_count (new_buffer));
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]