• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Creating custom VerticalRuler for NSScrollBar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Creating custom VerticalRuler for NSScrollBar
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: When are bound variables initialized?
  • Next by Date: Re: Drawing on integral values? WAS proper boarder.
  • Previous by thread: Re: debugger woes
  • Next by thread: Re: Creating custom VerticalRuler for NSScrollBar
  • Index(es):
    • Date
    • Thread