diff options
author | Havoc Pennington <hp@redhat.com> | 2000-10-24 22:44:14 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2000-10-24 22:44:14 +0000 |
commit | 2fab0eb1fa92964cca24d55e51203c5af5113c8e (patch) | |
tree | 6198960908bd87ef72de178dd3ad0452d825832a /tests/testtext.c | |
parent | 873b316f2346ad4cc928b798337d35f46a0ec716 (diff) | |
download | gtk+-2fab0eb1fa92964cca24d55e51203c5af5113c8e.tar.gz |
make it a static function
2000-10-24 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_scroll_to_mark_adjusted): make
it a static function
* gtk/gtktextbtree.c (gtk_text_btree_tag): Gee, maybe we should
redraw text when a tag is applied to it.
* gtk/gtktexttag.c (gtk_text_tag_affects_size)
(gtk_text_tag_affects_nonsize_appearance): private functions to
see if a tag requires various kinds of redraw/layout to be queued
up.
* gtk/gtktexttag.h (struct _GtkTextTag): Remove relief crackrock
* gtk/testtext.c (fill_example_buffer): Put the cursor
at the start of the buffer, so search works by default
* gtk/gtktextiter.c (lines_match): init match_start always
* gtk/gtktextbuffer.c (gtk_text_buffer_get_iter_at_line_index): New
function, get iter at a line + a byte index
* gtk/gtktextiter.c (gtk_text_iter_set_line_index): New function,
to set byte position within a line
(gtk_text_iter_check): remove leftover G_BREAKPOINT thing
Diffstat (limited to 'tests/testtext.c')
-rw-r--r-- | tests/testtext.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/testtext.c b/tests/testtext.c index d813d6fed4..dcc363b6fe 100644 --- a/tests/testtext.c +++ b/tests/testtext.c @@ -421,6 +421,10 @@ fill_example_buffer (GtkTextBuffer *buffer) GdkPixbuf *pixbuf; int i; char *str; + + /* FIXME this is broken if called twice on a buffer, since + * we try to create tags a second time. + */ tag = gtk_text_buffer_create_tag (buffer, "fg_blue"); @@ -581,9 +585,13 @@ fill_example_buffer (GtkTextBuffer *buffer) g_object_unref (G_OBJECT (pixbuf)); printf ("%d lines %d chars\n", - gtk_text_buffer_get_line_count (buffer), - gtk_text_buffer_get_char_count (buffer)); + gtk_text_buffer_get_line_count (buffer), + gtk_text_buffer_get_char_count (buffer)); + /* Move cursor to start */ + gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0); + gtk_text_buffer_place_cursor (buffer, &iter); + gtk_text_buffer_set_modified (buffer, FALSE); } |