• 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: NSButtonCell subclass (partially transparent images)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButtonCell subclass (partially transparent images)


  • Subject: Re: NSButtonCell subclass (partially transparent images)
  • From: "Erik M. Buck" <email@hidden>
  • Date: Fri, 8 Feb 2002 20:53:52 -0600
  • Organization: EMB & Assocites Inc.

I have annotated your code:

> - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView
> *)controlView {
> [controlView lockFocus]; // NOT NEEDED
> [[self image] compositeToPoint:cellFrame.origin
> operation:NSCompositeCopy];
> [controlView unlockFocus]; // NOT NEEDED
> [controlView setNeedsDisplay:YES]; // NOT NEEDED
> }
>
> Assuming that [self image] is properly loaded, why would this code not
> draw anything?

if [self image] returns non-nil and cellFrame.origin is in the visible
portion of controlView and drawInteriorWithFrame:inView: is actually being
called then it should draw the image.

See http://www.stepwise.com/Articles/Technical/NSCell.html
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSButtonCell subclass (partially transparent images)
      • From: Darrin Filer <email@hidden>
References: 
 >Re: NSButtonCell subclass (partially transparent images) (From: Darrin Filer <email@hidden>)

  • Prev by Date: Re: NSButtonCell subclass (partially transparent images)
  • Next by Date: Re: Why Cocoa source code isn't open? [terribly OT]
  • Previous by thread: Re: NSButtonCell subclass (partially transparent images)
  • Next by thread: Re: NSButtonCell subclass (partially transparent images)
  • Index(es):
    • Date
    • Thread