Re: NSScroller methods not being called
Re: NSScroller methods not being called
- Subject: Re: NSScroller methods not being called
- From: Troy Stephens <email@hidden>
- Date: Fri, 25 Jan 2008 15:35:38 -0800
On Jan 25, 2008, at 3:20 PM, Michael Watson wrote:
Thanks for the heads-up, Troy. I was tempted to override -drawRect,
but wasn't sure if it was the "right way", 'cause of the docs.
Understood. As with any other kind of NSView, though, -drawRect: is
the top-level method that gets invoked to ask an NSScroller to draw
itself. -drawRect: isn't explicitly listed in the reference
documentation for most view/control classes, since it's inherited, but
it is the common basis for all view/control drawing.
Don't suppose there's a method to tell if the scroller is horizontal
that isn't in the docs, is there?
There isn't a method for this specific purpose, but an NSScroller
considers itself horizontal if NSWidth(frame) > NSHeight(frame) at the
time it's created; vertical otherwise.
Troy
On 25 Jan, 2008, at 16:24, Troy Stephens wrote:
Hi Michael,
The above methods are holdovers from the OpenStep API and aren't
actually used on Mac OS X; they were obsoleted in the transition to
the Aqua scroller appearance in 10.0. The reference documentation
on them is out of date. (I'm filing a bug to get that fixed.)
If you need to do custom scroller drawing, overriding one or more of:
- (void)drawRect:(NSRect)rect;
- (void)drawKnob;
- (void)drawKnobSlotInRect:(NSRect)slotRect highlight:(BOOL)flag;
- (void)highlight:(BOOL)flag;
is the way to go.
Sorry for the confusion.
--
Troy Stephens
Cocoa Frameworks
Apple, Inc.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden