not sure if anyone is opposed to adding something like
this...
it provides a userInfo browser to the exception panel
which gets shown when you click on the icon in the
upper left hand corner.
i find it very useful when doing key value coding
stuff
and you have dictionaries with arrays of dictionaries
and stuff
it isn't the most polished looking but it does the job.
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com Index: Source/NSAlert.m
===
--- Source/NSAlert.m(revision 23935)
+++ Source/NSAlert.m(working copy)
@@ -163,10 +163,12 @@
@class GSAlertPanel;
[EMAIL PROTECTED] GSExceptionPanel;
static GSAlertPanel*standardAlertPanel = nil;
static GSAlertPanel*informationalAlertPanel = nil;
static GSAlertPanel*criticalAlertPanel = nil;
+static GSAlertPanel*nonstandardExceptionPanel = nil;
@interface GSAlertPanel: NSPanel
{
@@ -869,6 +871,7 @@
static GSAlertPanel*
getSomePanel(
GSAlertPanel **instance,
+ Class panelClass,
NSString *defaultTitle,
NSString *title,
NSString *message,
@@ -882,7 +885,7 @@
{
if ([*instance isActivePanel])
{ // c:
- panel = [[GSAlertPanel alloc] init];
+ panel = [[panelClass alloc] init];
}
else
{ // b:
@@ -891,7 +894,7 @@
}
else
{ // a:
- panel = [[GSAlertPanel alloc] init];
+ panel = [[panelClass alloc] init];
*instance = panel;
}
@@ -928,8 +931,8 @@
message = [NSString stringWithFormat: msg arguments: ap];
va_end(ap);
- return getSomePanel(&standardAlertPanel, defaultTitle, title, message,
-defaultButton, alternateButton, otherButton);
+ return getSomePanel(&standardAlertPanel, [GSAlertPanel class], defaultTitle,
+ title, message, defaultButton, alternateButton, otherButton);
}
int
@@ -954,8 +957,8 @@
defaultButton = @"OK";
}
- panel = getSomePanel(&standardAlertPanel, defaultTitle, title, message,
-defaultButton, alternateButton, otherButton);
+ panel = getSomePanel(&standardAlertPanel, [GSAlertPanel class], defaultTitle,
+ title, message, defaultButton, alternateButton, otherButton);
result = [panel runModal];
NSReleaseAlertPanel(panel);
return result;
@@ -1001,8 +1004,8 @@
defaultButton = @"OK";
}
- panel = getSomePanel(&standardAlertPanel, @"Alert", title, message,
-defaultButton, alternateButton, otherButton);
+ panel = getSomePanel(&standardAlertPanel, [GSAlertPanel class], @"Alert",
+ title, message, defaultButton, alternateButton, otherButton);
result = [panel runModal];
NSReleaseAlertPanel(panel);
return result;
@@ -1025,8 +1028,8 @@
message = [NSString stringWithFormat: msg arguments: ap];
va_end(ap);
- return getSomePanel(&criticalAlertPanel, @"Critical", title, message,
-defaultButton, alternateButton, otherButton);
+ return getSomePanel(&criticalAlertPanel, [GSAlertPanel class], @"Critical",
+ title, message, defaultButton, alternateButton, otherButton);
}
@@ -1047,8 +1050,8 @@
message = [NSString stringWithFormat: msg arguments: ap];
va_end(ap);
- panel = getSomePanel(&criticalAlertPanel, @"Critical", title, message,
-defaultButton, alternateButton, otherButton);
+ panel = getSomePanel(&criticalAlertPanel, [GSAlertPanel class], @"Critical",
+ title, message, defaultButton, alternateButton, otherButton);
result = [panel runModal];
NSReleaseAlertPanel(panel);
return result;
@@ -1070,8 +1073,8 @@
message = [NSString stringWithFormat: msg arguments: ap];
va_end(ap);
- return getSomePanel(&informationalAlertPanel, @"Information", title, message,
-defaultButton, alternateButton, otherButton);
+ return getSomePanel(&informationalAlertPanel, [GSAlertPanel class],
+ @"Information", title, message, defaultButton, alternateButton,
otherButton);
}
@@ -1093,6 +1096,7 @@
va_end(ap);
panel = getSomePanel(&informationalAlertPanel,
+ [GSAlertPanel class],
@"Information",
title, message,
defaultButton, alternateButton, otherButton);
@@ -1140,8 +1144,8 @@
defaultButton = @"OK";
}
- panel = getSomePanel(&standardAlertPanel, defaultTitle, title, message,
-defaultButton, alternateButton, otherButton);
+ panel = getSomePanel(&standardAlertPanel, [GSAlertPanel class],
defaultTitle,
+ title, message, defaultButton, alternateButton, otherButton);
// FIXME: We should also change the button action to call endSheet:
[NSApp beginSheet: panel
@@ -1172,8 +1176,8 @@
message = [NSString stringWithFormat: msg arguments: