NSButtons have drawing "artefacts" around them when clicked on a window/custom view bezel
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