Re: NSButtons have drawing "artefacts" around them when clicked on a window/custom view bezel
Re: NSButtons have drawing "artefacts" around them when clicked on a window/custom view bezel
- Subject: Re: NSButtons have drawing "artefacts" around them when clicked on a window/custom view bezel
- From: Martin Redington <email@hidden>
- Date: Wed, 18 Oct 2006 12:57:23 +0100
sorry, I should have been more precise.
The buttons are children of the custom view, so they are "inside" it,
rather than sitting on top.
Window
ContentView
RoundedView
NSButton
On 18 Oct 2006, at 08:36, Mike Abdullah wrote:
On 18 Oct 2006, at 04:45, Martin Redington wrote:
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.
I think this is your problem. Your buttons should not site on the
custom view, but inside of it.
Mike.
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:
40gmail.com
This email sent to email@hidden
_______________________________________________
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