comparison mac/dw.m @ 1896:8637a32d33d9

Logic error caused the alert style to get set after the alert was shown.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 25 Oct 2013 16:56:08 +0000
parents fafe1a68f0fd
children 74f50459c530
comparison
equal deleted inserted replaced
1895:fafe1a68f0fd 1896:8637a32d33d9
3388 3388
3389 va_start(args, format); 3389 va_start(args, format);
3390 alert = [NSAlert alertWithMessageText:[ NSString stringWithUTF8String:title ] defaultButton:button1 alternateButton:button2 otherButton:button3 informativeTextWithFormat:@"%@", [[[NSString alloc] initWithFormat:[NSString stringWithUTF8String:format] arguments:args] autorelease]]; 3390 alert = [NSAlert alertWithMessageText:[ NSString stringWithUTF8String:title ] defaultButton:button1 alternateButton:button2 otherButton:button3 informativeTextWithFormat:@"%@", [[[NSString alloc] initWithFormat:[NSString stringWithUTF8String:format] arguments:args] autorelease]];
3391 va_end(args); 3391 va_end(args);
3392 3392
3393 iResponse = [alert runModal];
3394
3395 if(flags & DW_MB_ERROR) 3393 if(flags & DW_MB_ERROR)
3396 [alert setAlertStyle:NSCriticalAlertStyle]; 3394 [alert setAlertStyle:NSCriticalAlertStyle];
3397 else if(flags & DW_MB_INFORMATION) 3395 else if(flags & DW_MB_INFORMATION)
3398 [alert setAlertStyle:NSInformationalAlertStyle]; 3396 [alert setAlertStyle:NSInformationalAlertStyle];
3399 else 3397 else
3400 [alert setAlertStyle:NSWarningAlertStyle]; 3398 [alert setAlertStyle:NSWarningAlertStyle];
3401 3399
3400 iResponse = [alert runModal];
3401
3402 switch(iResponse) 3402 switch(iResponse)
3403 { 3403 {
3404 case NSAlertDefaultReturn: /* user pressed OK */ 3404 case NSAlertDefaultReturn: /* user pressed OK */
3405 if(flags & DW_MB_YESNO || flags & DW_MB_YESNOCANCEL) 3405 if(flags & DW_MB_YESNO || flags & DW_MB_YESNOCANCEL)
3406 { 3406 {