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: Alexander Malmberg
Subject: Re: NSButtonCell value, contents and cell type implementation rewritten
Date: Fri, 03 Sep 2004 01:22:51 +0200
User-agent: Mozilla Thunderbird 0.5 (X11/20040306)

Quentin Mathé wrote:
Le 31 août 04, à 03:51, Alexander Malmberg a écrit :
Quentin Mathé wrote:
hmm, Alexander, is this ok to commit ?

No. :)

You are joking, I'm sure :-).

In a sense, but the no is real (for the patch in that mail, and for the reasons given in the response).

The cell type-related changes seem a bit odd. Could you explain why this is the right thing to do?

Well it is explained in detail in the thread "[PATCH] Proposal to fix NSButtonCell issue with -setFont: -setTitle:" which is split between gnustep-dev and bug-gnustep…

OK, I'll check there.

[snip]
For the new implementations of set*Value: in NSButtonCell to work properly, you'll need to remove or rework the implementation of these methods in NSButton.

ok, I will do it. But I would prefer to have this set of patches committed first, but I'm not sure it is possible…

It is possible, but it isn't good to have inconsistent behavior depending on whether you call the value setters in NSButtonCell or the value setters in NSButton. Also, depending on how you fix the display issue, fixing this may be as easy as removing the methods (since the NSControl implementations do the Right Thing).

There seem to be some issues with redisplaying an NSButton after calling these methods. Exactly where the redisplay is done is the subject of future cleanups, but it does need to be done somewhere (ie. calling [NSButton -set*Value:] must somehow result in a -setNeedsDisplay: on the button if the state changes).

Well, I will need some more precise input or opinion from you here. Fred also probably ?

You can either call -setNeedsDisplay: in all the -set.*Value: methods in NSButton (after passing the call on to the cell), or do the _control_view updateCell: thing in NSButtonCell. For consistency, I'd recommend the latter. It should be enough to just override -setState: and, after calling super, adding the following:

  if (_control_view)
    if ([_control_view isKindOfClass: controlClass])
      [(NSControl *)_control_view updateCell: self];

(NSActionCell has a bunch of examples of this.)

Also...

Gregory John Casamento wrote:
> As always, please ensure that older revisions of NSButton are properly
> unarchived if/when this change is applied.

... from looking at the code, it seems like this is ok, but it should be tested on some app that uses .gorm:s and has a button (probably most of them :).

- Alexander Malmberg




reply via email to

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