Creating custom VerticalRuler for NSScrollBar
Creating custom VerticalRuler for NSScrollBar
- Subject: Creating custom VerticalRuler for NSScrollBar
- From: Till Niese <email@hidden>
- Date: Tue, 12 Apr 2005 21:29:53 +0200
I'd like to create a custom VerticalRuler that contains the Line Numbers, but i'm not sure if i do this the right way.
if create a custom ScrollView:
I created a Scroll View returning my Ruler class
"MyScrollView.h"
@interface MyScrollView : NSScrollView
{}
@end
"MyScrollView.m"
@implementation MyScrollView
+ (Class)rulerViewClass {
return [MyTestRuler class];
}
@end
And a custom Ruler Class:
"MyTestRuler.h"
@interface MyTestRuler : NSView {
NSScrollView *myView;
NSRulerOrientation myOrientation;
}
- (id)initWithScrollView:(NSScrollView *)aScrollView orientation:(NSRulerOrientation)orientation;
- (float)requiredThickness;
- (void) _scrollToMatchContentView;
@end
"MyTestRuler.h"
@implementation MyTestRuler
- (id)initWithScrollView:(NSScrollView *)aScrollView orientation:(NSRulerOrientation)orientation {
[super init];
myView = aScrollView;
myOrientation = orientation;
return self;
}
- (float)requiredThickness {
return 60;
}
- (void)drawRect:(NSRect)rect
{}
- (void) _scrollToMatchContentView {}
- (void) invalidateHashMarks {}
@end
this works fine, but im not sure about the "
_scrollToMatchContentView" it's no where listed and seems Apple internal, so i don't know if it will be supported in future OS releases.
Is this the right way do to this or should i MyTestRuler extend NSRulerView ?
or is this completely the wrong way ?
-Till
_______________________________________________
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