Re: Home and end keys and NSTableView, not handled automatically?
Re: Home and end keys and NSTableView, not handled automatically?
- Subject: Re: Home and end keys and NSTableView, not handled automatically?
- From: "Sean McBride" <email@hidden>
- Date: Thu, 16 Sep 2004 18:52:55 -0400
Allan Odgaard (email@hidden) on Tue, Sep 14, 2004 06:22 said:
>> Firstly, since page up and page down are handled automatically surely
>> home and end could be too. Is this omission a bug?
>
>The second last paragraph at
><http://developer.apple.com/documentation/Cocoa/Conceptual/
>BasicEventHandling/Concepts/KeyEvents.html> mentions: "A case in point
>of a superview handling a keyboard-action message initiated by a
>subview is the way the NSScrollView object handles page-down commands
>[...]"
So I'm trying to make home/end work in the 'right' way....
That doc goes on to say: "This scroll-view object is a compound object
consisting of a document view, a clip view (an NSClipView object) and a
scroller (an NSScroller object). Because it is the containing or
coordinating object, the NSScrollView object is the superview of all
other objects in this grouping. Now say your custom view is the document
view of the scroll view. If you implement keyDown: to send
interpretKeyEvents: to the input manager but do not implement the
scrollPageDown: action method, the document view will still be scrolled
within the scroll view when the user presses the Page Down key (or
whatever key binding is in effect for that function). This happens
because each next responder in the responder chain is queried to see if
it responds to scrollPageDown:. The NSScrollView class provides a default
implementation, so this implementation is invoked."
The last 2 sentences seem wrong. The docs show no scrollPageDown: in
NSScrollView and indeed if I try I get:
2004-09-16 18:15:18.764 Futzing[730] *** -[NSScrollView scrollPageDown:]:
selector not recognized
And if, in my NSTableView subclass (subview of scroll view), I implement
keyDown as so:
- (void)keyDown:(NSEvent*)event
{
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
}
page up and page down stop working.
I must be misunderstanding something here....
I was hoping to implement keyDown like above, and add
scrollToBeginningOfDocument: and scrollToEndOfDocument: to my NSTableView
subclass.
_______________________________________________
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