Re : Need Help With NSScrollView & possible NSClipView
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