[gtk+/gtk-3-20] gtk-demo: Don't duplicate text in markup example



commit 13a14d071a821baffdab5f06e04e670e9d000ca3
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 6 20:47:49 2016 -0400

    gtk-demo: Don't duplicate text in markup example
    
    I forgot to clear the buffer before inserting the new markup. Oops.

 demos/gtk-demo/markup.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/demos/gtk-demo/markup.c b/demos/gtk-demo/markup.c
index 898df8c..5e856b6 100644
--- a/demos/gtk-demo/markup.c
+++ b/demos/gtk-demo/markup.c
@@ -28,7 +28,8 @@ source_toggled (GtkToggleButton *button)
       markup = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
 
       buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
-      gtk_text_buffer_get_start_iter (buffer, &start);
+      gtk_text_buffer_get_bounds (buffer, &start, &end);
+      gtk_text_buffer_delete (buffer, &start, &end);
       gtk_text_buffer_insert_markup (buffer, &start, markup, -1);
       g_free (markup);
 


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