Re: custom NSRulerView
Re: custom NSRulerView
- Subject: Re: custom NSRulerView
- From: Marco Binder <email@hidden>
- Date: Thu, 30 Jan 2003 17:43:47 +0100
1) the method signature is --> + <-- (void)
setRulerViewClass:(Class)aClass
the "plus" tells you, that the method is a class method: you can only
call it on classes (here [NSScrollView setRulerViewClass:yourclass])
2) the argument for the above method is of type (Class), NOT (id)
[which would be an object]. You can not pass your ruler object! You
have to pass [MyRulerView class]
marco
Am Donnerstag, 30.01.03 um 16:36 Uhr schrieb Koen van der Drift:
Hi,
I want to customize an NSRuler of a NSScrollView, and from the
documentation I found the method setRulerViewClass. So In MyDocument I
call:
- (void)windowControllerDidLoadNib:(NSWindowController *) aController
{
[super windowControllerDidLoadNib:aController];
NSScrollView *scroller = [myTextView enclosingScrollView];
MyRulerView *ruler;
ruler = [[MyRulerView alloc] init];
[scroller setRulerViewClass: ruler];
[scroller setHasVerticalRuler:YES];
[scroller setRulersVisible:YES];
[ruler release];
}
However, I get an error that scroller doesn't respond to
setRulerViewClass. This is from the docs:
+ (void)setRulerViewClass:(Class)aClass
Sets the default class to be used for ruler objects in NSScrollViews
to aClass. This class is normally NSRulerView, but you can use this
method to set it to a custom subclass of NSRulerView.
how do I solve this?
thanks,
- Koen.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
--
|\ /| E-Mail: email@hidden WWW: www.marco-binder.de
| \/ | Telefon: 07531 / 94 19 94 Fax: 07531 / 94 19 92
| |ARCO Snail-Mail: Banater Str. 3 - 78467 Konstanz
BINDER _____________________________________________________
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.