[text] Add select-all binding

Bind Ctrl+A to the "select all" action.
This commit is contained in:
Emmanuele Bassi 2009-01-05 12:27:45 +00:00
parent 92e8b886d2
commit 55a22d5750

View File

@ -1379,6 +1379,18 @@ clutter_text_real_line_end (ClutterText *self,
return TRUE;
}
static gboolean
clutter_text_real_select_all (ClutterText *self,
const gchar *action,
guint keyval,
ClutterModifierType modifiers)
{
clutter_text_set_cursor_position (self, 0);
clutter_text_set_selection_bound (self, self->priv->n_chars);
return TRUE;
}
static gboolean
clutter_text_real_del_next (ClutterText *self,
const gchar *action,
@ -1929,6 +1941,11 @@ clutter_text_class_init (ClutterTextClass *klass)
CLUTTER_KP_End,
G_CALLBACK (clutter_text_real_line_end));
clutter_binding_pool_install_action (binding_pool, "select-all",
CLUTTER_a, CLUTTER_CONTROL_MASK,
G_CALLBACK (clutter_text_real_select_all),
NULL, NULL);
clutter_binding_pool_install_action (binding_pool, "delete-next",
CLUTTER_Delete, 0,
G_CALLBACK (clutter_text_real_del_next),