gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButtonCell value, contents and cell type implementation rewritten


From: Quentin Mathé
Subject: Re: NSButtonCell value, contents and cell type implementation rewritten
Date: Wed, 1 Sep 2004 14:56:03 +0200

Le 30 août 04, à 21:06, Fred Kiefer a écrit :

Quentin Mathé wrote:
Well, here is the NSButtonCell.m patch but without the new methods disposition in order to ease the comparison between the previous NSButtonCell.m version and this new version…

Hi Quentin,

most of this patch looks nice to me. At one place you did remove the braces of an if statement and I don't see any reason for that. The GNUstep coding style expects them to be there. This is not allways the case in your actual code, but removing them is surely not right.

hmm… Where it is ?

The only question I have with this patch is, if it would not be simpler to use a call to the setType: method in the class NSCell, instead of the direct setting of _cell.type and just overwrite that method in NSButtonCell to do nothing.

Well it was my first idea, but it isn't possible.

This does not work easyly with the current implementation of [NSCell setType:], but if we takle care to convert the type first and than to set attributes it should do.

To convert the type to what ? And which attributes ?

Could you please test if Cocoa does call the method or if everything is done on the same low level as we do it.

The Cocoa behavior is explained in the patch :

+ * On Mac OS X, the NSButtonCell cell type is NSTextCellType by default or + * NSImageCellType if the initialization has been done with -initImageCell:,
+    * it should be noted that the cell type never changes later.

To be more precise I have tested that -[NSCell setType] is never called when you create a new NSButtonCell and it is the case.

But even without changing this your patch has my ok.

ok, thanks.

Quentin.

--
Quentin Mathé
address@hidden




reply via email to

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