• 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: Donald Brown <email@hidden>
  • Date: Fri, 08 Feb 2002 20:38:30 -0600

I have a circular button with a little lock in it, instead of the word
"unlock". [self image] holds the picture of the lock, it does not hold the
circular bubble. (I change the image between a closed lock and open lock.)

Your code would copy my lock, but not the bubble around it.

Donald

on 2/8/02 8:23 PM, Darrin Filer at email@hidden wrote:

> 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.

--
Donald Brown
email@hidden
http://www.eamontales.com

We have met the enemy and he is us - Pogo
_______________________________________________
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: Termination of threads.
  • Next by Date: Re: NSButtonCell subclass (partially transparent images)
  • Previous by thread: Re: NSButtonCell subclass (partially transparent images)
  • Next by thread: Re: NSButtonCell subclass (partially transparent images)
  • Index(es):
    • Date
    • Thread