• 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
Re: Cocoa autoscroll question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa autoscroll question


  • Subject: Re: Cocoa autoscroll question
  • From: Jeremy French <email@hidden>
  • Date: Sun, 27 Feb 2005 15:07:44 -0500

TO SET UP THE "AUTOMATIC SCROLLING REGION"
----
Create a subclass of NSView, perhaps named "MyView". Import the class into Interface Builder, and then do the following:

1) Drag a "custom view" onto the window.
2) Select the "custom view", and change its class to MyView.
3) With the MyView instance selected, choose LAYOUT -> MAKE SUBVIEW OF - SCROLL VIEW.
4) Select the scroll view, and position accordingly. Also set its automatic resizing.
5) Double click on the NSScrollView until you select MyView.
6) Using the InfoPanel, make MyView's dimensions greater than the scroll view.

You should now be able to scroll MyView.

TO PROGRAM THE AUTO SCROLLING FUNCTIONALITY
---
In the "mouseDown:" method implemented in MyView, add the following line:

[[self superview] autoscroll:event];

where event is the NSEvent parameter passed to the mouseDown method.

SOME DOCUMENTATION
---
The book "Cocoa Programming for Mac OSX (second edition)" by Aaron Hillegrass has several chapters on this. See chapters 14 and 15.

---

On Feb 26, 2005, at 5:34 PM, Mark Dawson wrote:

I see that I can program NSView's autoscroll: to allow automatic scrolling when the user hits the "automatic scrolling region". However, I wasn't clear how to do that.
(1) How do I set up the "automatic scrolling region" and
(2) How do program the auto scrolling functionality?
I didn't see much documentation other than references that it could be done.

 _______________________________________________
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: Cocoa autoscroll question
      • From: Mark Dawson <email@hidden>
References: 
 >Cocoa autoscroll question (From: Mark Dawson <email@hidden>)

  • Prev by Date: Changing the IBeamCursor colour in an NSTextView
  • Next by Date: Re: Tiger seeds download problems
  • Previous by thread: Cocoa autoscroll question
  • Next by thread: Re: Cocoa autoscroll question
  • Index(es):
    • Date
    • Thread