diff test/testime.c @ 3132:88861448961f gsoc2009_IME

Add SDL_TEXTEDTING event to inform application about marked text.
author Jiang Jiang <gzjjgod@gmail.com>
date Wed, 01 Jul 2009 07:33:58 +0000
parents 009bd8f81947
children 84119fe89d26
line wrap: on
line diff
--- a/test/testime.c	Wed Jul 01 05:52:17 2009 +0000
+++ b/test/testime.c	Wed Jul 01 07:33:58 2009 +0000
@@ -111,6 +111,15 @@
             SDL_StartTextInput(&markedRect);
             break;
 
+        case SDL_TEXTEDITING:
+            fprintf(stderr, "text editing \"%s\", selected range (%d, %d)\n",
+                    event.edit.text, event.edit.start, event.edit.length);
+
+            SDL_FillRect(screen, &markedRect, backColor);
+            render_text(screen, font, event.edit.text, markedRect.x, markedRect.y, textColor);
+            SDL_Flip(screen);
+            break;
+
         case SDL_QUIT:
             done = 1;
             break;