Actually when you have set the font or the title of a button cell with the -setFont: or -setTitle: methods, you cannot anymore retrieve the image associated with the button cell because the cell has been converted from NSImageCellType to NSTextCellType and the -image method is written like that :
- (NSImage*) image
{
if (_cell.type == NSImageCellType)
{
return _cell_image;
}
else
return nil;
}

The code above is in accordance with the specification. Then I propose to not change this method but to simplify NSButtonCell -setFont: -setTitle: like in the patch below… in order to have the cell type not changed when you call -setFont: and -setTitle:. I propose to have the cell type changed only by the -setImagePosition: method.

Attachment: NSButtonCell.m.patch
Description: Binary data



We have such issue because NSButtonCell unlike NSCell can have a title (_contents ivar with a specified font) without being an NSTextCellType cell but an NSImageCellType cell by using an image.

Quentin.

--
Quentin Mathé
[EMAIL PROTECTED]
_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to