• 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: Darrin Filer <email@hidden>
  • Date: Fri, 8 Feb 2002 21:23:09 -0500

The button/buttonCell's image has been set. This can be verified from the debugger or by simply commenting out the overridden functions. In which case it renders normally since the subclass isn't overriding any of NSButtonCell's methods.

The following code should draw the cell's image into its control's view, right? Break points are reached in this function from which I've verified that cellFrame, controlView, and [self image] are all reasonable values... baffling

- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
[controlView lockFocus];
[[self image] compositeToPoint:cellFrame.origin operation:NSCompositeCopy];
[controlView unlockFocus];
[controlView setNeedsDisplay:YES];
}

Assuming that [self image] is properly loaded, why would this code not draw anything?

darrin filer

On Friday, February 8, 2002, at 04:59 PM, Erik M. Buck wrote:

The image that you get via [self image] is not the image of the button
itself. It is the optional image that is displayed instead of or along with
a title. If there is no image associated with a button then your code will
not draw anything.
_______________________________________________
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.
_______________________________________________
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: "Erik M. Buck" <email@hidden>
    • Re: NSButtonCell subclass (partially transparent images)
      • From: Donald Brown <email@hidden>
References: 
 >Re: NSButtonCell subclass (partially transparent images) (From: "Erik M. Buck" <email@hidden>)

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