mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 03:40:47 +00:00
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:
parent
19ab7c514b
commit
b895c014f2
1 changed files with 28 additions and 0 deletions
|
@ -395,6 +395,33 @@ fprintf(stderr, " TextField mouseDown --- ");
|
||||||
// If not editable then don't recognize the key down
|
// If not editable then don't recognize the key down
|
||||||
if (![self isEditable]) return;
|
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
|
// Hide the cursor during typing
|
||||||
[NSCursor hide];
|
[NSCursor hide];
|
||||||
|
|
||||||
|
@ -404,6 +431,7 @@ fprintf(stderr, " TextField mouseDown --- ");
|
||||||
[window flushWindow];
|
[window flushWindow];
|
||||||
[self unlockFocus];
|
[self unlockFocus];
|
||||||
// [self setNeedsDisplay: YES];
|
// [self setNeedsDisplay: YES];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) keyUp: (NSEvent *)theEvent
|
- (void) keyUp: (NSEvent *)theEvent
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue