Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Masna

macrumors newbie
Original poster
Apr 20, 2007
8
0
Hey everyone.

I'm currently writing a custom NSScroller class (to change its look). But, I'm having trouble drawing the arrows. Basically, when is drawArrow:highlight: called? I assumed it'd be called whenever drawKnob was called (or at least in init and whenever it's clicked), but apparently not.

Thanks in advance!
 

letof

macrumors newbie
Jun 7, 2007
1
0
drawArrow:highlight: from drawRect:

Basically, when is drawArrow:highlight: called?

from drawRect: BUT DEFAULT IMPLEMENTATION DOES NOT DO THIS ! :mad:

overwrite drawRect: in your subclass.

Code:
- (void)drawRect:(NSRect)rect
{
//#warning unexpected method [NSScroller drawKnobSlotInRect:highlight:]
	[self drawKnobSlotInRect:[self rectForPart:NSScrollerKnobSlot] highlight:NO] ;
	[self drawArrow:NSScrollerIncrementArrow highlight:( [self hitPart] == NSScrollerIncrementLine )] ;
	[self drawArrow:NSScrollerDecrementArrow highlight:( [self hitPart] == NSScrollerDecrementLine )] ;
	[self drawKnob] ;
}

Note : drawKnobSlotInRect:highlight: does not appear in NSScroller interface too !

Bug or not ? I don't know !

Read you later.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.