[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Proposal to fix NSButtonCell issue with -setFont: -setTitle:
From: |
Quentin Mathé |
Subject: |
[PATCH] Proposal to fix NSButtonCell issue with -setFont: -setTitle: |
Date: |
Tue, 30 Mar 2004 12:06:44 +0200 |
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.
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é
qmathe@club-internet.fr
- [PATCH] Proposal to fix NSButtonCell issue with -setFont: -setTitle:,
Quentin Mathé <=