Re: NSStatusItem hack (free code!!)
Re: NSStatusItem hack (free code!!)
- Subject: Re: NSStatusItem hack (free code!!)
- From: Steve Gehrman <email@hidden>
- Date: Fri, 14 Feb 2003 03:28:36 -0800
This code is better, use this instead of the previous
drawInteriorWithFrame I posted....
I left in some older stuff that was is longer necessary.
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView
*)controlView
{
NSImage *image = [self image];
if (image)
{
NSPoint origin;
int controlHeight = cellFrame.size.height;
int imageHeight = [image size].height;
// now draw the image
origin = cellFrame.origin;
origin.y += cellFrame.size.height;
origin.y -= ((controlHeight - imageHeight) /2);
if ([self isHighlighted])
[image compositeToPoint:origin
operation:NSCompositeSourceOver];
else
[image compositeToPoint:origin operation:NSCompositeCopy];
}
else
[super drawInteriorWithFrame:cellFrame inView:controlView];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.