* Source/NSAlert.m: (-_initWithoutGModel): Set selected text

background color to white. Now we can see selection of message text.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24681 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sergii Stoian 2007-02-21 23:54:12 +00:00
parent a4fba19c11
commit 4cef45fd98

View file

@ -330,6 +330,8 @@ setControl(NSView* content, id control, NSString *title)
NSRect r = NSMakeRect(0.0, 0.0, WinMinWidth, WinMinHeight);
NSFont *titleFont = [NSFont systemFontOfSize: 18.0];
float titleHeight = [titleFont boundingRectForFont].size.height;
NSText *fieldEditor = [self fieldEditor: YES forObject: messageField];
NSDictionary *selectedAttrs;
self = [self initWithContentRect: r
@ -372,7 +374,7 @@ setControl(NSView* content, id control, NSString *title)
titleField = [[NSTextField alloc] initWithFrame: rect];
[titleField setAutoresizingMask: NSViewMinYMargin];
[titleField setEditable: NO];
[titleField setSelectable: YES];
[titleField setSelectable: NO];
[titleField setBezeled: NO];
[titleField setDrawsBackground: NO];
[titleField setStringValue: @""];
@ -395,16 +397,20 @@ setControl(NSView* content, id control, NSString *title)
rect.size.width = 0.0;
rect.origin.y = 0.0;
rect.origin.x = 0.0;
messageField = [[NSTextField alloc] initWithFrame: rect];
[messageField setEditable: NO];
[messageField setSelectable: YES];
/*
PJB:
How do you want the user to report an error message if it is
not selectable? Any text visible on the screen should always
be selectable for a copy-and-paste. Hence, setSelectable: YES.
*/
selectedAttrs = [NSDictionary dictionaryWithObjectsAndKeys:
[NSColor whiteColor],
NSBackgroundColorAttributeName];
[(NSTextView *)fieldEditor setSelectedTextAttributes: selectedAttrs];
[messageField setSelectable: YES];
[messageField setBezeled: NO];
[messageField setDrawsBackground: NO];
[messageField setAlignment: NSCenterTextAlignment];