[tests] Verify cursor position
authorEmmanuele Bassi <ebassi@linux.intel.com>
Thu, 14 May 2009 11:05:57 +0000 (12:05 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Thu, 14 May 2009 11:05:57 +0000 (12:05 +0100)
Print out the cursor and selection positions in order to verify
the behaviour of the Text actor.

This is a likely candidate for a conformance test unit as well.

tests/interactive/test-text-field.c

index 260fc5f..fbb51de 100644 (file)
@@ -28,7 +28,10 @@ static void
 on_entry_activate (ClutterText *text,
                    gpointer     data)
 {
-  g_print ("Text activated: %s\n", clutter_text_get_text (text));
+  g_print ("Text activated: %s (cursor: %d, selection at: %d)\n",
+           clutter_text_get_text (text),
+           clutter_text_get_cursor_position (text),
+           clutter_text_get_selection_bound (text));
 }
 
 static ClutterActor *