diff options
author | Sébastien Wilmet <swilmet@gnome.org> | 2014-07-20 15:44:12 +0200 |
---|---|---|
committer | Sébastien Wilmet <swilmet@gnome.org> | 2014-07-29 15:21:23 +0200 |
commit | 8ad9cf8b8c0ad0106e8cdd83f17e2627bf9226cf (patch) | |
tree | df0efed8a324fa9b1a9188973516754c95f75062 /gtk/gtktextbuffer.c | |
parent | 86d9628a94157a9541250551e826bfc272587184 (diff) | |
download | gtk+-8ad9cf8b8c0ad0106e8cdd83f17e2627bf9226cf.tar.gz |
textbuffer: emit notify signal for the "text" property
Although there is the "changed" signal, it is more correct to notify the
"text" property too. It can be useful for a small text view, where the
text is saved e.g. to gsettings with a binding to the text property.
The "text" property includes only the text, not child widgets or images,
so the notify signal is sent too many times (also for child widgets and
images), but it's not a big problem.
https://bugzilla.gnome.org/show_bug.cgi?id=624791
Diffstat (limited to 'gtk/gtktextbuffer.c')
-rw-r--r-- | gtk/gtktextbuffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index 0af7cf7e90..672353ceb7 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -878,8 +878,6 @@ gtk_text_buffer_set_text (GtkTextBuffer *buffer, gtk_text_buffer_get_iter_at_offset (buffer, &start, 0); gtk_text_buffer_insert (buffer, &start, text, len); } - - g_object_notify (G_OBJECT (buffer), "text"); } @@ -2545,6 +2543,8 @@ static void gtk_text_buffer_real_changed (GtkTextBuffer *buffer) { gtk_text_buffer_set_modified (buffer, TRUE); + + g_object_notify (G_OBJECT (buffer), "text"); } static void |