アップルDevのフォーラムからの開発者は、正しい方向に私を指摘:https://devforums.apple.com/message/364824
は、ここで私はIBから代替画像を尊重NSPopUpButtonCellのサブクラスとして思い付いたものです:
- (void)drawImageWithFrame:(NSRect)cellRect inView:(NSView *)controlView{
NSImage *image = self.image;
if([self isHighlighted] && self.alternateImage){
image = self.alternateImage;
}
//TODO: respect -(NSCellImagePosition)imagePosition
NSRect imageRect = NSZeroRect;
imageRect.origin.y = (CGFloat)round(cellRect.size.height*0.5f-image.size.height*0.5f);
imageRect.origin.x = (CGFloat)round(cellRect.size.width*0.5f-image.size.width*0.5f);
imageRect.size = image.size;
[image drawInRect:imageRect
fromRect:NSZeroRect
operation:NSCompositeSourceOver
fraction:1.0f
respectFlipped:YES
hints:nil];
}
注こと'respectFlipped'は' YES'でなければなりません –
ヒントありがとうございました:) – keegan3d