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: Fred Kiefer
Subject: Re: NSButtonCell value, contents and cell type implementation rewritten
Date: Thu, 09 Sep 2004 00:55:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114

Fred Kiefer wrote:
Quentin Mathé wrote:
My patch isn't in any way a NSCell rewrite, it is a NSButtonCell rewrite, in the case you want to rewrite NSCell to use -setType: more often you can. For NSButtonCell, the only time the cell type is changed, it is with -setImagePosition: and in this precise case it is impossible to use the NSCell method -setType because of the side effect. Otherwise it is needed to override -setType: to do nothing in NSButtonCell to match somewhat the Cocoa behavior, and more importantly to have a consistent and nice behavior (I explained that in detail and it seems we have already agreed on this in the previous thread [PATCH] Proposal to fix NSButtonCell issue with -setFont: -setTitle:)


You already do need to change a few methods on NSCell and even more in NSButtonCell just because NSCell doesn't do what you want it to do. Your patch consists of two main area. One is about exchanging the way state and title are handled, which is mostly fine for me (apart from the cleanup that Alexander wants for NSButton), the other part is the way the type of a NSBUttonCell changes. For this bit my impression is that your patch would be simpler and cleaner if we changed NSCell to use setType: everywhere (apart from the init method) and than would just overwrite this method in NSButtonCell.


I just changed the suggested methods in NSCell myself. Your patch should no become lot simpler as methods like setFont: or setTitle: no longer require a rewrite. I hope the code change makes it a bit clearer what I wanted to say.

For example setTitle: could look like this:

 - (void) setTitle: (NSString*)aString
  {
    [super setStringValue: aString];
  }







reply via email to

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