• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSStatusItem hack (free code!!)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: How to know that a NSDocument is new or open from a file ?
  • Next by Date: Protecting singleton objects from releasing
  • Previous by thread: NSStatusItem hack (free code!!)
  • Next by thread: How to know that a NSDocument is new or open from a file ?
  • Index(es):
    • Date
    • Thread