mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:10:47 +00:00
Fixed the possibility to call -setImagePosition: after -setImage: broke with the previous commit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20309 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9364c7163f
commit
ee1cfbe06c
2 changed files with 30 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2004-11-08 Quentin Mathe <qmathe@club-internet.fr>
|
||||||
|
|
||||||
|
* Source/NSButtonCell.m (-setImage:): Added overriden NSCell method in
|
||||||
|
order to have the cell switched to an image cell (with the NSImageOnly
|
||||||
|
position) when you call -setImage:. With the previous commit, when the
|
||||||
|
cell is a text cell and you call -setImagePosition: after -setImage:,
|
||||||
|
the cell image is released.
|
||||||
|
|
||||||
2004-11-07 Quentin Mathe <qmathe@club-internet.fr>
|
2004-11-07 Quentin Mathe <qmathe@club-internet.fr>
|
||||||
|
|
||||||
* Source/NSCell.m (-type): Now returns NSNullCellType when the image
|
* Source/NSCell.m (-type): Now returns NSNullCellType when the image
|
||||||
|
|
|
@ -133,13 +133,13 @@
|
||||||
- (void) setType: (NSCellType)aType
|
- (void) setType: (NSCellType)aType
|
||||||
{
|
{
|
||||||
/* We do nothing here (we match the Mac OS X behavior) because with
|
/* We do nothing here (we match the Mac OS X behavior) because with
|
||||||
* NSButtonCell GNUstep implementation the cell type is binded to the image
|
* NSButtonCell GNUstep implementation the cell type is bound to the image
|
||||||
* position. Such behavior has been choosen because it permits to have
|
* position. We implemented this behavior because it permits to have
|
||||||
* -setFont: -setTitle -setImage: methods which are symetrical by not altering
|
* -setFont: -setTitle -setImage: methods which are symetrical by not altering
|
||||||
* the cell type, morevover a cell type is more characterized by the potential
|
* directly the cell type and to validate the fact that the cell type is more
|
||||||
* visibility of the image (which is under the control of the method
|
* characterized by the potential visibility of the image (which is under the
|
||||||
* -setImagePosition:) than by the value of the image ivar itself (related to
|
* control of the method -setImagePosition:) than by the value of the image
|
||||||
* -setImage: method).
|
* ivar itself (related to -setImage: method).
|
||||||
* On Mac OS X, the NSButtonCell cell type is NSTextCellType by default or
|
* On Mac OS X, the NSButtonCell cell type is NSTextCellType by default or
|
||||||
* NSImageCellType if the initialization has been done with -initImageCell:,
|
* NSImageCellType if the initialization has been done with -initImageCell:,
|
||||||
* it should be noted that the cell type never changes later.
|
* it should be noted that the cell type never changes later.
|
||||||
|
@ -363,6 +363,22 @@
|
||||||
return _cell.image_position;
|
return _cell.image_position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setImage: (NSImage *)anImage
|
||||||
|
{
|
||||||
|
if (anImage)
|
||||||
|
{
|
||||||
|
NSAssert ([anImage isKindOfClass: [NSImage class]],
|
||||||
|
NSInvalidArgumentException);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_cell.image_position == NSNoImage)
|
||||||
|
{
|
||||||
|
[self setImagePosition: NSImageOnly];
|
||||||
|
}
|
||||||
|
|
||||||
|
ASSIGN (_cell_image, anImage);
|
||||||
|
}
|
||||||
|
|
||||||
- (void) setAlternateImage: (NSImage*)anImage
|
- (void) setAlternateImage: (NSImage*)anImage
|
||||||
{
|
{
|
||||||
ASSIGN(_altImage, anImage);
|
ASSIGN(_altImage, anImage);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue