diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-10-30 04:13:24 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-10-30 04:13:24 +0000 |
commit | 41312f2c998406e739e560593959721a2f052f11 (patch) | |
tree | 4f2c0552e75117b44cfd970cd353d65dd08b6512 /tests/testtext.c | |
parent | 64c295b3feb54195d199675070dfdcdd47d26961 (diff) | |
download | gtk+-41312f2c998406e739e560593959721a2f052f11.tar.gz |
Add a "Select All" menuitem. (#156792, Paolo Borelli)
2004-10-30 Matthias Clasen <mclasen@redhat.com>
* tests/testtext.c: Add a "Select All" menuitem. (#156792,
Paolo Borelli)
Diffstat (limited to 'tests/testtext.c')
-rw-r--r-- | tests/testtext.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/testtext.c b/tests/testtext.c index 80fc9bbb6b..a33c90703d 100644 --- a/tests/testtext.c +++ b/tests/testtext.c @@ -1232,6 +1232,21 @@ do_search (gpointer callback_data, gtk_widget_show_all (dialog); } +static void +do_select_all (gpointer callback_data, + guint callback_action, + GtkWidget *widget) +{ + View *view = view_from_widget (widget); + GtkTextBuffer *buffer; + GtkTextIter start, end; + + buffer = view->buffer->buffer; + + gtk_text_buffer_get_bounds (buffer, &start, &end); + gtk_text_buffer_select_range (buffer, &start, &end); +} + typedef struct { /* position is in coordinate system of text_view_move_child */ @@ -1511,6 +1526,7 @@ static GtkItemFactoryEntry menu_items[] = { "/_Edit", NULL, 0, 0, "<Branch>" }, { "/Edit/Find...", NULL, do_search, 0, NULL }, + { "/Edit/Select All", "<control>A", do_select_all, 0, NULL }, { "/_Settings", NULL, NULL, 0, "<Branch>" }, { "/Settings/Wrap _Off", NULL, do_wrap_changed, GTK_WRAP_NONE, "<RadioItem>" }, |