test-text-field: Grab key focus on the first entry

So that you can start typing right away.
This commit is contained in:
Emmanuele Bassi 2010-12-30 12:49:41 +00:00
parent 2fe20ff3c5
commit bf0dd2cbcc

View File

@ -269,7 +269,7 @@ test_text_field_main (gint argc,
gchar **argv) gchar **argv)
{ {
ClutterActor *stage; ClutterActor *stage;
ClutterActor *box; ClutterActor *box, *entry;
ClutterLayoutManager *table; ClutterLayoutManager *table;
clutter_init (&argc, &argv); clutter_init (&argc, &argv);
@ -297,8 +297,9 @@ test_text_field_main (gint argc,
"y-expand", FALSE, "y-expand", FALSE,
NULL); NULL);
entry = create_entry (CLUTTER_COLOR_LightGray, "<i>some</i> text", 0, 0);
clutter_box_pack (CLUTTER_BOX (box), clutter_box_pack (CLUTTER_BOX (box),
create_entry (CLUTTER_COLOR_LightGray, "<i>some</i> text", 0, 0), entry,
"row", 0, "row", 0,
"column", 1, "column", 1,
"x-expand", TRUE, "x-expand", TRUE,
@ -323,6 +324,7 @@ test_text_field_main (gint argc,
"y-expand", FALSE, "y-expand", FALSE,
NULL); NULL);
clutter_actor_grab_key_focus (entry);
clutter_actor_show (stage); clutter_actor_show (stage);
clutter_main (); clutter_main ();