summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/application10/exampleappwin.c11
-rw-r--r--examples/application9/exampleappwin.c11
2 files changed, 2 insertions, 20 deletions
diff --git a/examples/application10/exampleappwin.c b/examples/application10/exampleappwin.c
index a9311ec5a2..7b0dc46575 100644
--- a/examples/application10/exampleappwin.c
+++ b/examples/application10/exampleappwin.c
@@ -134,16 +134,7 @@ update_lines (ExampleAppWindow *win)
view = gtk_bin_get_child (GTK_BIN (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
- count = 0;
-
- gtk_text_buffer_get_start_iter (buffer, &iter);
- while (!gtk_text_iter_is_end (&iter))
- {
- count++;
- if (!gtk_text_iter_forward_line (&iter))
- break;
- }
-
+ count = gtk_text_buffer_get_line_count (buffer);
lines = g_strdup_printf ("%d", count);
gtk_label_set_text (GTK_LABEL (win->lines), lines);
g_free (lines);
diff --git a/examples/application9/exampleappwin.c b/examples/application9/exampleappwin.c
index 50ad92a4ac..6d6ae980e9 100644
--- a/examples/application9/exampleappwin.c
+++ b/examples/application9/exampleappwin.c
@@ -134,16 +134,7 @@ update_lines (ExampleAppWindow *win)
view = gtk_bin_get_child (GTK_BIN (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
- count = 0;
-
- gtk_text_buffer_get_start_iter (buffer, &iter);
- while (!gtk_text_iter_is_end (&iter))
- {
- count++;
- if (!gtk_text_iter_forward_line (&iter))
- break;
- }
-
+ count = gtk_text_buffer_get_line_count (buffer);
lines = g_strdup_printf ("%d", count);
gtk_label_set_text (GTK_LABEL (win->lines), lines);
g_free (lines);