[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSComboBox : how to set the width properly ?
From: |
Stéphane Goujet |
Subject: |
Re: NSComboBox : how to set the width properly ? |
Date: |
Sat, 21 May 2005 15:32:58 GMT |
On Sat, 21 May 2005, Fred Kiefer wrote:
It is the same if one uses the sizeToFit method. I find that totally
illogical : NSComboBox calculates the width to fit on the text field, but
then it does not use it to set its own text field width... instead it
substracts from it the button width. So a sizeToFit never fits, the end of
the text is hidden by the button...
This seems to be a real problem. NSComboBoxCell does not implement the method
cellSize, which should return the optimal size for the text cell plus the
button.
Also, there is an extra problem. When you set the frame width to be the
width of the text field plus the width of the button, the display of the
original NSComboBox is OK. But when you click on the button and the list
appears, the scroller is again inside the text field. I mean it takes some
room, so the space for texts in the list is too short again.
I think that in Cocoa, the scroller does not steal space from the text
fields, it is added on the right of the list (under the button). Isn't
that better ? Like that there is not this width problem in the list, and
because it is on the right of the list, the text fields of the list are
aligned with the text field of the NSComboBox. Also the use of the mouse
pointer is easier, because you do not have to go from the button on the
right to the scroller on the left ; you just have to move the mouse down.
What is your opinion ?
Goodbye,
Stéphane.