• 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
NSButtons have drawing "artefacts" around them when clicked on a window/custom view bezel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSButtons have drawing "artefacts" around them when clicked on a window/custom view bezel


  • Subject: NSButtons have drawing "artefacts" around them when clicked on a window/custom view bezel
  • From: Martin Redington <email@hidden>
  • Date: Wed, 18 Oct 2006 04:45:30 +0100


I have a window/custom view combination that draws a bezel type window on the screen, with rounded corners.


The window has a stylemask  NSBorderlessWindowMask

and the following settings:

[self setLevel:NSStatusWindowLevel];
[self setBackgroundColor: [NSColor clearColor]];
//        [self setBackgroundColor: [NSColor blackColor]];
[self setHasShadow:NO];
[self setMovableByWindowBackground:YES];
[self setOpaque:NO];

The custom view is Matt Gemmell's RoundedView, and simply draws a rounded rectangle in its drawRect: method, in black, with an intermediate alpha value.

This produces a nice semi-transparent bezel type window, with rounded corners.

I have a couple of standard NSButtons sitting on top of the custom view. When these are clicked, the non-button portion of the control (i.e. within the buttons rect, but outside the actual button itself) gets mostly filled in in white, and remains that way. This is very unattractive. A help button seems to have a slight artefact in its rect right from the get-go.

I can get rid of this effect by either changing the setOpaque: call in the window to YES, or by ditching the rounded view, and changing the window background color to black (the commented out line above).
Then the buttons behave normally. However, in either case, I lose my nice rounded corners.


I guess I can somehow work around this by fiddling with the button cell's or something, but any pointers would be welcome.







_______________________________________________
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


  • Follow-Ups:
    • Re: NSButtons have drawing "artefacts" around them when clicked on a window/custom view bezel
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Request [:.VIRUS.:]
  • Next by Date: How to get hyperlink in a html file?
  • Previous by thread: Request [:.VIRUS.:]
  • Next by thread: Re: NSButtons have drawing "artefacts" around them when clicked on a window/custom view bezel
  • Index(es):
    • Date
    • Thread