• 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
How do I subclass the NSScrollView of PDFView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How do I subclass the NSScrollView of PDFView?
      • From: John Calhoun <email@hidden>
  • Prev by Date: Re: ESC to cancel editing in tableview
  • Next by Date: Re: How do I get Lucida Grande italic into my application?
  • Previous by thread: Re: NSPopupButton with NSArrayController
  • Next by thread: Re: How do I subclass the NSScrollView of PDFView?
  • Index(es):
    • Date
    • Thread