Hi all,
in NSPopUpButtonCell we have
- (NSSize) cellSize
{
NSSize s;
NSSize imageSize;
NSSize titleSize;
int i, count;
NSString *title;
count = [_menu numberOfItems];
if (count == 0)
return NSZeroSize;
imageSize = [_pbc_image[_pbcFlags.pullsDown] size];
s = NSMakeSize(0, imageSize.height);
for (i = 0; i < count; i++)
{
title = [[_menu itemAtIndex: i] title];
titleSize = [self _sizeText: title];
if (titleSize.width > s.width)
s.width = titleSize.width;
if (titleSize.height > s.height)
s.height = titleSize.height;
}
s.width += imageSize.width;
s.width += 5; /* Left border to text (border included) */
s.width += 3; /* Text to Image */
s.width += 4; /* Right border to image (border included) */
/* (vertical) border: */
s.height += 2 * (_sizeForBorderType (NSBezelBorder).height);
/* Spacing between border and inside: */
s.height += 2 * 1;
s.width += 2 * 3;
return s;
}
If the PoPUpButton has no items yet, this method returns NSZeroSize.
That's definitely wrong! I do
NSSize titleSize = NSMakeSize(10,28);
// if (count == 0) return NSZeroSize;
now which is of course a hack of its own but at least works for markup
based interfaces. If anybody has a better idea ...
Regards,
Andreas
_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep