gnustep-dev
[Top][All Lists]
Advanced

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

Questions to NSButtonCell


From: Fred Kiefer
Subject: Questions to NSButtonCell
Date: Mon, 22 Jan 2007 14:25:28 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20060911)

While I working on NSButtonCell I stumbled over a few questions that I
am not able to solve myself. Perhaps one of you knows some of the answers.

1. Gradients
I tried to get gradients for a button to display on my Mac, but failed
to see any difference. How do I enable gradient display?
I want to get this displayed to decide if the method
drawGradientWithFrame:inView: does the correct thing. Even then this
method would need to be renamed or moved to GSTheme, but I suspect that
it does the wrong thing. The code here fills the whole button with the
gradient, I would expect that only the border needs to be shaded.

2. Cell Frame
All my previous test on MacOSX suggest, that the cell frame being passed
into drawInteriorWithFrame:inView: is exactly the same that did get
passed into drawWithFrame:inView:. But in the current GNUstep
implementation this frame gets reduced by the size of the bezel border.
This solution is a lot more elegant, but it will break porting between
Cocoa and GNUstep, if there is indeed a difference. I think what we need
to do is correct drawingRectForBounds: to ask the theme for the size of
the border.

3. border and bezel
Now NSCell has two different concepts for its border. It is either a
simple line, in which case it is called border, or a more complex thing,
then it is called bezel. For NSButtonCell these two seem to be merged.
Our code only checks the border flag, but it will draw a bezel.
I think that our code is correct, but we should get it better in sync
with the cell code.

4. show state
Why are we in the case of highlighted button cells subtracting the shows
state by mask from the highlight mask? This may be fully correct, I just
don't get the reasoning behind it.

There are more questions, but these are the ones, where I have given up
finding a solution myself.

Cheers,
Fred




reply via email to

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