How do I subclass the NSScrollView of PDFView?
How do I subclass the NSScrollView of PDFView?
- Subject: How do I subclass the NSScrollView of PDFView?
- From: Eric Badros <email@hidden>
- Date: Fri, 05 Jan 2007 21:51:07 -0500
Hi All,
I'm trying to replace the NSScrollViews that control scrolling for two
PDFView subclass instances so that I can synchronize scrolling.
I've already tested my SynchroScrollView subclasses on an NSImageView and
they work...I just don't know how to replace the scrollViews within PDFView.
I can't get into the PDFView through the hierarchical view. And I've tried
to replace the entire class in my PDFView subclass (SynchroScrollView for
NSScrollView) with:
- (id) initWithCoder: (NSCoder *) decoder
{
BOOL useSetClass = NO;
BOOL useDecodeClassName = NO;
if ( [decoder respondsToSelector: @selector
(setClass:forClassName:)] ) {
useSetClass = YES;
[(NSKeyedUnarchiver *) decoder setClass: [SynchroScrollView class]
forClassName: @"NSScrollView"];
}
else if ( [decoder respondsToSelector: @selector
(decodeClassName:asClassName:)] ) {
useDecodeClassName = YES;
[(NSUnarchiver *) decoder decodeClassName: @"NSScrollView"
asClassName: @"SynchroScrollView"];
}
self = [super initWithCoder: decoder];
if ( useSetClass ) {
[(NSKeyedUnarchiver *) decoder setClass: [SynchroScrollView class]
forClassName: @"NSScrollView"];
}
else if ( useDecodeClassName ) {
[(NSUnarchiver *) decoder decodeClassName: @"NSScrollView"
asClassName: @"SynchroScrollView"];
}
return self;
}
And while my PDFView subview reflects this change...it doesn't work...any
ideas?
Thank you for your help.
-------------------
Eric Badros
Www.badros.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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