Re: mouse clicks and first responders
Re: mouse clicks and first responders
- Subject: Re: mouse clicks and first responders
- From: email@hidden
- Date: Wed, 7 May 2003 20:52:21 +0200
On mercredi, mai 7, 2003, at 06:44 PM, Alex Rice wrote:
How can one pass through a mouse click so that in addition to making
the window the first responder, the underlying object receives the
event?
For example, in my app I have a NSWindow and a NSPanel. The NSWindow
has an NSOutlineview. There is an row selected in the NSOutlineView.
The NSPanel has the focus. When I click on another row in the
NSOutlineView, the click only brings into focus the NSWindow, it
doesn't propogate as a click with the NSOutlineView. A second click is
required to select another row in the NSOutlineView.
Subclass NSOutlineView and implement:
acceptsFirstMouse:
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
Overridden by subclasses to return YES if the receiver should be sent a
mouseDown: message for theEvent, an initial mouse-down event over the
receiver in its window, NO if not. The receiver can either return a
value unconditionally, or use the location of theEvent to determine
whether or not it wants the event. NSView's implementation ignores
theEvent and returns NO.
Override this method in a subclass to allow instances to respond to
initial mouse-down events. For example, most view objects refuse an
initial mouse-down event, so the event simply activates the window.
Many control objects, however, such as NSButton and NSSlider, do accept
them, so the user can immediately manipulate the control without having
to release the mouse button.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.