src/video/uikit/SDL_uikitmessagebox.m
changeset 6686 45014250760c
parent 6619 42214b6959c5
child 6714 146d1d7ecdc4
     1.1 --- a/src/video/uikit/SDL_uikitmessagebox.m	Mon Jul 23 00:14:07 2012 -0400
     1.2 +++ b/src/video/uikit/SDL_uikitmessagebox.m	Sun Nov 25 10:03:22 2012 -0800
     1.3 @@ -28,6 +28,7 @@
     1.4  
     1.5  /* Display a UIKit message box */
     1.6  
     1.7 +static SDL_bool s_showingMessageBox = SDL_FALSE;
     1.8  
     1.9  @interface UIKit_UIAlertViewDelegate : NSObject <UIAlertViewDelegate> {
    1.10  @private
    1.11 @@ -60,6 +61,12 @@
    1.12  @end // UIKit_UIAlertViewDelegate
    1.13  
    1.14  
    1.15 +SDL_bool
    1.16 +UIKit_ShowingMessageBox()
    1.17 +{
    1.18 +    return s_showingMessageBox;
    1.19 +}
    1.20 +
    1.21  int
    1.22  UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
    1.23  {
    1.24 @@ -86,9 +93,12 @@
    1.25      
    1.26      // Run the main event loop until the alert has finished
    1.27      // Note that this needs to be done on the main thread
    1.28 +    s_showingMessageBox = SDL_TRUE;
    1.29      while (clicked == messageboxdata->numbuttons) {
    1.30          [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
    1.31      }
    1.32 +    s_showingMessageBox = SDL_FALSE;
    1.33 +
    1.34      *buttonid = messageboxdata->buttons[clicked].buttonid;
    1.35  
    1.36      [pool release];