开发者

How to make knob track of a NSScroller transparent?

开发者 https://www.devze.com 2023-02-08 01:21 出处:网络
This is my application screenshot.There is only one NSScrollView on the window.开发者_运维技巧I have made the other parts of the scrollview transparent,except the knob slot.

How to make knob track of a NSScroller transparent?

This is my application screenshot.There is only one NSScrollView on the window.开发者_运维技巧I have made the other parts of the scrollview transparent,except the knob slot.

Here is my draw code for custom NSScroller subclass.

- (void) drawRect: (NSRect)dirtyRect
{
    [[NSColor clearColor] set];
    NSRectFill(dirtyRect);

    [self drawKnob];
}

Does anyone have a clue to make this work? Thanks a lot.


OK,I solve this myself.Here is the code.

- (void) drawRect: (NSRect)dirtyRect
{
    NSDrawWindowBackground([self bounds]);
    [self drawKnob];
}

Though it is not really transparent, but the effect is what I want.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号