开发者

How to make knob track of a NSScroller transparent?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜