summaryrefslogtreecommitdiff
path: root/gtk/gtktextbtree.c
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2003-01-06 22:34:23 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2003-01-06 22:34:23 +0000
commitbc70dc94bf6392a7503ebd81092494631a272c44 (patch)
treeb6d9d87acf4be094a3a9401f86fa54a929b1a6f8 /gtk/gtktextbtree.c
parent41f2f7974e8d5ccd52543d82b92e1ff2c7ce3c2d (diff)
downloadgdk-pixbuf-bc70dc94bf6392a7503ebd81092494631a272c44.tar.gz
Implement a utility function proposed in #102534:
2003-01-06 Matthias Clasen <maclas@gmx.de> Implement a utility function proposed in #102534: * gtk/gtktextbtree.h: * gtk/gtktextbtree.c (_gtk_text_btree_select_range): New function. (_gtk_text_btree_place_cursor): Now a simple wrapper around _gtk_text_btree_select_range(). * gtk/gtktextbuffer.h: * gtk/gtktextbuffer.c (gtk_text_buffer_select_range): New function. (gtk_text_buffer_place_cursor): Now a simple wrapper around gtk_text_buffer_select_range().
Diffstat (limited to 'gtk/gtktextbtree.c')
-rw-r--r--gtk/gtktextbtree.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c
index 3fa504d2c..dd180a227 100644
--- a/gtk/gtktextbtree.c
+++ b/gtk/gtktextbtree.c
@@ -2656,6 +2656,14 @@ void
_gtk_text_btree_place_cursor (GtkTextBTree *tree,
const GtkTextIter *iter)
{
+ _gtk_text_btree_select_range (tree, iter, iter);
+}
+
+void
+_gtk_text_btree_select_range (GtkTextBTree *tree,
+ const GtkTextIter *ins,
+ const GtkTextIter *bound)
+{
GtkTextIter start, end;
if (_gtk_text_btree_get_selection_bounds (tree, &start, &end))
@@ -2663,11 +2671,12 @@ _gtk_text_btree_place_cursor (GtkTextBTree *tree,
/* Move insert AND selection_bound before we redisplay */
real_set_mark (tree, tree->insert_mark,
- "insert", FALSE, iter, TRUE, FALSE);
+ "insert", FALSE, ins, TRUE, FALSE);
real_set_mark (tree, tree->selection_bound_mark,
- "selection_bound", FALSE, iter, TRUE, FALSE);
+ "selection_bound", FALSE, bound, TRUE, FALSE);
}
+
void
_gtk_text_btree_remove_mark_by_name (GtkTextBTree *tree,
const gchar *name)