test/testime.c
branchgsoc2009_IME
changeset 3136 962357f325e1
parent 3134 f896821736fb
child 3137 311c678f3b2e
     1.1 --- a/test/testime.c	Thu Aug 06 08:56:48 2009 +0000
     1.2 +++ b/test/testime.c	Thu Aug 06 08:59:53 2009 +0000
     1.3 @@ -65,6 +65,7 @@
     1.4  
     1.5  void CleanupVideo()
     1.6  {
     1.7 +    SDL_StopTextInput();
     1.8      TTF_CloseFont(font);
     1.9      TTF_Quit();
    1.10  }
    1.11 @@ -82,6 +83,8 @@
    1.12      text[0] = 0;
    1.13      markedRect = textRect;
    1.14      markedText = NULL;
    1.15 +
    1.16 +    SDL_StartTextInput();
    1.17  }
    1.18  
    1.19  static void RenderText(SDL_Surface *sur,
    1.20 @@ -115,6 +118,8 @@
    1.21      if (markedRect.w < 0)
    1.22      {
    1.23          SDL_Flip(screen);
    1.24 +        // Stop text input because we cannot hold any more characters
    1.25 +        SDL_StopTextInput();
    1.26          return;
    1.27      }
    1.28  
    1.29 @@ -139,7 +144,7 @@
    1.30  
    1.31      SDL_Flip(screen);
    1.32  
    1.33 -    SDL_StartTextInput(&markedRect);
    1.34 +    SDL_SetTextInputRect(&markedRect);
    1.35  }
    1.36  
    1.37  void