Re:
Re:
- Subject: Re:
- From: Brian Webster <email@hidden>
- Date: Thu, 12 Sep 2002 09:00:52 -0500
On Thursday, September 12, 2002, at 12:00 AM,
email@hidden wrote:
I've overridden NSSplitView because I'd like to add an NSButtonCell in
the divider column that allows the split view to be toggle between
being open or closed.
<snip>
The "arrowButton" appears exactly where I would like it to. However, it
does not respond to mouseclicks at all.
I think I need to add arrowButton to the responder chain. If so, how do
I do this?
Alternatively, is there a better way to go about doing this?
A cell is not part of the view hierarchy and must be given events by
some member of the view hierarchy, usually an NSControl of some kind.
There are two ways you could go about this:
1. Use an NSButton instead of an NSButtonCell. This would mean that
you would have to maintain the button's proper position in the split
view when the slider moves, but it would give you automatic support for
clicks that occur within the button's bounds.
2. Route the mouse clicks manually to the NSButtonCell's
trackMouse:inRect:ofView:untilMouseUp: method (defined in NSCell). You
would need to detect when click fell within the cell's bounds and
basically do what NSButton does to feed the events to the cell for
tracking.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.