fix: CPAlert fails to runModal if ran sheetModal before

This commit is contained in:
Antoine Mercadal committed 2010-11-11 17:38:39 +01:00
1 parent 38033d9dcb
commit 6b42ef3cb1
1 file changed
+9
+9
View File
@@ -495,6 +495,12 @@ CPCriticalAlertStyle = 2;
*/
- (void)runModal
{
if (!([_window styleMask] & CPTitledWindowMask))
{
_needsLayout = YES;
[self _createWindowWithStyle:CPTitledWindowMask];
}
[self layout];
[CPApp runModalForWindow:_window];
}
@@ -510,7 +516,10 @@ CPCriticalAlertStyle = 2;
- (void)beginSheetModalForWindow:(CPWindow)aWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)alertDidEndSelector contextInfo:(id)contextInfo
{
if (!([_window styleMask] & CPDocModalWindowMask))
{
_needsLayout = YES;
[self _createWindowWithStyle:CPDocModalWindowMask];
}
[self layout];