I'm trying to create a simple dialog box from within a very simple application. It's the only UI in the application. But when I call RunStandardAlert, the buttons are non-responsive, and the function call never returns. I am not using Carbon or Cocoa anywhere else in the app.
This is the code I am using, from the Carbon tutorial. I am calling this directly from my main() function, but I have also tried calling calling RunApplicationEventLoop() after registering an event loop timer with InstallEventLoopTimer() so I could call the below code from there in case there was some magic going on when you run your application event loop that does the setup required for dialog boxes to work (voodoo!).
DialogRef theItem;
DialogItemIndex itemIndex;
CreateStandardAlert(kAlertStopAlert, CFSTR("Oh dear, the penguin’s disappeared."),
CFSTR("I hope you weren’t planning to open source him."), NULL, &theItem);
RunStandardAlert (theItem, NULL, &itemIndex);