advertisement

Article:
  Building a Scratch Pad with Cocoa
Subject:   How to use scrolling in a NSView Subclass
Date:   2001-12-31 07:06:24
From:   zeus
I tri to make a very simple sofware, and in that sofware I need to scroll the view. Here is my code:


-(void)mouseDown:(NSEvent *) theEvent{
NSPoint loc = [theEvent locationInWindow];
loc.x -= [self frame].origin.x;
loc.y -= [self frame].origin.y;
[self scrollPoint:loc];
[self setNeedsDisplay:YES];
}

I'm using a methode scrollPoint:aPoint from the NSView Class but i can't hardly get a scroll. I'm sure that i'm going into this method because when I ran my soft in debugger mode I get the right coordinates of the point "loc".


Does anyone have an idea ?


1 to 1 of 1
  1. I'm going to try to say what's going on
    2002-01-01 19:35:03  psheldon [View]

    • I'm going to try to say what's going on
      2002-01-03 08:02:33  zeus [View]

1 to 1 of 1