> Am 08.05.2020 um 17:48 schrieb Andreas Höschler <[email protected]>:
>
>> that is a very interesting analysis you provided. Could you tell us a bit
>> more about the images you are using? Or to be concrete, what is the size of
>> one of these images? If these images report such huge values for their
>> height this would explain the behaviour you are seeing.
>
> The images are rather tiny. Here is the one that caused the problem in one of
> the forms:
>
> <Contacts_RightArrow.tiff>
Yes, this looks rather small.
>> In NSButtonCell the computation of cellSize relies directly on the value
>> reported by the image. It would also be interesting to know, which value
>> gets used for the image position of the button cell.
>
> I don't set that. So I guess it's a default position!? Let's see ...
>
> @implementation NSButton (sizeToContent)
>
> - (void)sizeToFit
> {
> NSSize size = [_cell cellSize];
> if (size.height > 10000.0)
> {
> NSLog(@"Reporting button::imagePosition %d", [self imagePosition]);
> NSLog(@"Reporting _cell::imagePosition %d", [_cell imagePosition]);
> }
> [self setFrameSize: size];
> }
>
> @end
Could you please move the logging code one level down into the NSButtonCell and
report from there how this is calculated? Also report the image size as seen by
the cell. You could check the value of s.height at the end of the method and if
it is huge report textSize, imageSize and border
An image position of 2 should be NSImageLeft, which is fine.
Cheers,
Fred