test/testime.c
branchgsoc2009_IME
changeset 3136 962357f325e1
parent 3134 f896821736fb
child 3137 311c678f3b2e
--- a/test/testime.c	Thu Aug 06 08:56:48 2009 +0000
+++ b/test/testime.c	Thu Aug 06 08:59:53 2009 +0000
@@ -65,6 +65,7 @@
 
 void CleanupVideo()
 {
+    SDL_StopTextInput();
     TTF_CloseFont(font);
     TTF_Quit();
 }
@@ -82,6 +83,8 @@
     text[0] = 0;
     markedRect = textRect;
     markedText = NULL;
+
+    SDL_StartTextInput();
 }
 
 static void RenderText(SDL_Surface *sur,
@@ -115,6 +118,8 @@
     if (markedRect.w < 0)
     {
         SDL_Flip(screen);
+        // Stop text input because we cannot hold any more characters
+        SDL_StopTextInput();
         return;
     }
 
@@ -139,7 +144,7 @@
 
     SDL_Flip(screen);
 
-    SDL_StartTextInput(&markedRect);
+    SDL_SetTextInputRect(&markedRect);
 }
 
 void