• 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 : Need Help With NSScrollView & possible NSClipView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re : Need Help With NSScrollView & possible NSClipView


  • Subject: Re : Need Help With NSScrollView & possible NSClipView
  • From: Janakiram <email@hidden>
  • Date: Mon, 26 Sep 2005 10:27:15 +0530

Hi,

        To Scroll the NSView programatically  we can use

1) - (BOOL)autoscroll:(NSEvent *)theEvent

2)    - (BOOL)scrollRectToVisible:(NSRect)aRect


The First Method will be useful when we want to scroll the view using mouse.
This Method will be used in mouseDragged Event of NSView



- (void)mouseDragged:(NSEvent *)theEvent {

    [self(NSView) autoscroll: theEvent];

}


The Second Method will be usefule when we want to scroll the NSView using Keyboard arrow Keys.
This Method will be useful in keyDown Event of NSView.



- (void)keyDown:(NSEvent *)theEvent {

    NSRect visibleRect = [self visibleRect];

    Depending on u'rr key code add/subtract from the rect coordinates.

    Finally

    [self scrollRectToVisible: visibleRect];

}


Cheers, JanakiRam.

_______________________________________________
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


  • Prev by Date: QTKit for creating movies
  • Next by Date: Re: NSRectFIll() taking 0.03 seconds, too slow?
  • Previous by thread: Re: QTKit for creating movies
  • Next by thread: Where is the build log
  • Index(es):
    • Date
    • Thread