Text view (in custom view) - moving ruler markers below zero?
Text view (in custom view) - moving ruler markers below zero?
- Subject: Text view (in custom view) - moving ruler markers below zero?
- From: Keith Blount <email@hidden>
- Date: Wed, 16 Mar 2005 10:08:13 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hello,
I'm not sure if this is possible, and I can't find
anything in the docs about this, so would be very
grateful if anybody knows enough about NSRulerView to
offer me some advice.
I have a custom view with two subviews: custom margin
view on the left and an NSTextView on the right. This
custom view is contained inside a scroll view, which
has a horizontal ruler. This horizontal ruler view is
the default text view ruler, controlling tab stops
etc. Because my margin view is 100 pixels wide, I have
set the ruler's offset to 100. So far, so good - the
ruler view works perfectly.
However, what I would like to do is add a custom
marker at zero, and set it up so that if the user
drags this marker to a point below zero - ie, to a
point above the margin view - it will resize the
margin and text views so that the margin view stops at
the marker. I don't know how to do this, though - or
if it is possible at all.
I tried the following code after setting up the scroll
view as a test:
[[scrollView horizontalRulerView] setClientView:self];
NSRulerMarker *marker = [[NSRulerMarker alloc]
initWithRulerView:[scrollView horizontalRulerView]
markerLocation:2.0 image:[NSImage
imageNamed:@"test.tif"] imageOrigin:NSMakePoint(0,0)];
[[scrollView horizontalRulerView] addMarker:marker];
But no marker was added to the ruler view. Also, it
seems that it is impossible to move any marker beyond
the leftmost point of the text view so that it is over
the margin view. I tried using NSRulerView's client
method, rulerView:shouldMoveMarker:, and returning YES
to do this (I even tried subclassing NSTextView to
override this method), but this had no effect.
Does anybody know if this is possible, and if so,
where I might start?
Many thanks in advance,
Keith
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden