OK, sorry, I found where was the problem : I forgot to subclass -
(BOOL)isOpaque on my NSButton subclass so that it returns NO (my
NSButton is partially transparent).
Eric.
Le 7 sept. 05 à 19:15, Eric Morand a écrit :
> Hi list !
>
>
> I'm implementing my own NSButton subclass, currently only drawing a
> string, and have a strange problem when I click on my button : each
> time I click on my button, the string appears darker, just like if
> it was drawn above itself again and again !
>
> Here is the only thing I have subclassed in my NSButtonCell
> subclass (none my NSButton subclass method has been subclassed for
> the moment) :
>
>
> - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
> {
> [self drawInteriorWithFrame:cellFrame inView:controlView];
> }
>
> - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)
> controlView
> {
> [[self title] drawInRect:cellFrame withAttributes:nil];
> }
>
>
>
> It was just supposed to be a test, that's why it is so simple. But
> even with such a simple code, it doesn't work as expected.
>
>
> I don't understand why the string draw above itself each time I
> click on the button. Is there something I should had to erase the
> previous content of the cell ?
>
>
>
> Thanks,
>
>
> Eric.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<Cocoa-dev...>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<eric.morand...>
>
> This email sent to <eric.morand...>
>