• 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
image in a button problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

image in a button problem


  • Subject: image in a button problem
  • From: Ivan Kourtev <email@hidden>
  • Date: Sun, 12 Feb 2006 22:01:14 -0500

Hello,

I want to draw a small button completely filled with a custom image. The "bounding path" of the image is a circle and I want my button to be circular and just a tad bigger than the custom image (radius of button = radius of image + 2 pixels).

I set the button shape and image with the following sequence:

...
[button setButtonType:NSMomentaryPushInButton];
[button setBezelStyle:NSRecessedBezelStyle];
[button setImage:bImage];
...

and the image does show up.

However, it seems that the button is drawn of a middle component (a rectangle, I think) and two semicircles on the left and right side. If the button size is too small, then these two semi-circles overlay the image in the middle and obscure part of the image. It seems that the drawing algorithm for the button is: draw rectangular portion in the middle, draw image on top, draw two semicircles on left and right to complete button.

Is that the expected behavior or a bug? What would be the way to go? This behavior seems to be persistent across all button styles I experimented with. The only thing left to try I can think of is to make the button transparent, then draw the actual button shape and the image (not sure if possible and seems too difficult).

Any suggestions?  Thanks,

-- ivan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Who's launching me?
  • Next by Date: Re: Who's launching me?
  • Previous by thread: Re: Core Data, transient ivars and undo
  • Next by thread: nsarraycontroller, bindings and big databases
  • Index(es):
    • Date
    • Thread