Try to avoid crash when key event goes to text field cell

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4011 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-04-01 06:58:28 +00:00
parent 19ab7c514b
commit b895c014f2

View file

@ -395,6 +395,33 @@ fprintf(stderr, " TextField mouseDown --- ");
// If not editable then don't recognize the key down
if (![self isEditable]) return;
#if 1
{
NSRect cellFrame = bounds;
if ([cell isBordered])
{
cellFrame.origin.x += 1;
cellFrame.origin.y += 1;
cellFrame.size.width -= 2;
cellFrame.size.height -= 2;
}
else if ([cell isBezeled])
{
cellFrame.origin.x += 4;
cellFrame.origin.y += 2;
cellFrame.size.width -= 6;
cellFrame.size.height -= 4;
}
[cell editWithFrame: cellFrame
inView: self
editor: [window fieldEditor: YES forObject: cell]
delegate: self
event: theEvent];
}
#else
// Hide the cursor during typing
[NSCursor hide];
@ -404,6 +431,7 @@ fprintf(stderr, " TextField mouseDown --- ");
[window flushWindow];
[self unlockFocus];
// [self setNeedsDisplay: YES];
#endif
}
- (void) keyUp: (NSEvent *)theEvent