Re: NSRulerMarker question
Re: NSRulerMarker question
- Subject: Re: NSRulerMarker question
- From: Kyle Sluder <email@hidden>
- Date: Thu, 22 Nov 2012 15:22:15 -0800
On Thu, Nov 22, 2012, at 02:56 PM, Graham Cox wrote:
> Yes, that's right. The design of the NSRulerViewDelegate protocol
> suggests that doing this is possible. In fact, the documentation
> explicitly states that the delegate method can be used for this purpose.
> However, it does not work, and the presence of an undocumented black line
> in its place suggests that maybe the standard NSRulerMarker is either
> putting a window over mine in the way you suggest, or it's doing some
> hackery that physically prevents my view from getting its updates as
> normal during dragging. Overlaying a whole separate window should not be
> necessary and it strikes me as a heavy-handed approach, though it may be
> a possible solution.
Actually, based on breaking in the debugger, it looks like NSScrollView
is responsible for drawing that black line.
If you think about it, it makes sense that NSTextView cannot be
responsible for the black line, because NSTextView (in its default
configuration) sizes itself vertically to fit the used rect of its text
container, yet the line draws in the entire vertical extent of the
scroll view.
>
> It looks as if I need to subclass NSRulerMarker and completely
> reimplement its tracking method to allow it to work exactly as
> documented, which is bloody annoying, because what really should have
> been done is that NSTextView should have subclassed NSRulerMarker for its
> special case, or NSRulerMarker should have more public override points so
> that the black line behaviour can be modified or suppressed. At the very
> least these weird behaviours for NSTextView should be documented.
File a radar asking them to expose -[NSScrollView
_updateRulerlineForRuler:oldPosition:newPosition:vertical:] so you can
subclass it.
--Kyle Sluder
_______________________________________________
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