bug-gnustep
[Top][All Lists]
Advanced

[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.

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é
qmathe@club-internet.fr

reply via email to

[Prev in Thread] Current Thread [Next in Thread]