Fixed NSButtonCell -image returns nil

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20308 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Quentin Mathe 2004-11-07 20:59:16 +00:00
parent a93430ad56
commit 9ffc576add
3 changed files with 25 additions and 1 deletions

View file

@ -371,6 +371,18 @@
- (void) setImagePosition: (NSCellImagePosition)aPosition
{
_cell.image_position = aPosition;
// In the GNUstep NSButtonCell implementation, the cell type depends only on
// the image position.
if (_cell.image_position == NSNoImage)
{
[super setType: NSTextCellType];
}
else
{
[super setType: NSImageCellType];
}
}
/*
@ -1220,7 +1232,7 @@
{
[_sound play];
}
[super performClickWithFrame: cellFrame inView: controlView];
}

View file

@ -567,6 +567,9 @@ static NSColor *shadowCol;
- (NSCellType) type
{
if (_cell.type == NSImageCellType && _cell_image == nil)
return NSNullCellType;
return _cell.type;
}