From: Will T. <wi...@th...> - 2005-09-17 07:38:13
|
You should use the - (void)setDoubleAction:(SEL)aSelector and - (void) setTarget:(id)anObject methods on the table and outline views to call a method on a delegate object. You can then use clickedRow and clickedColumn to find out where you clicked. On 17 Sep 2005, at 2:39 am, Dave Howell wrote: > This is a nice, normal, totally on-topic query. :) I have a window. > It's got a TableView and an OutlineView. I want to know when a row > in either one has been double-clicked so I can open a new 'detail' > window for the clicked item. I thought this would work: > > class ProjectInterface < OSX::NSWindowController > > ns_overrides :mouseDown_ > ib_outlet :projectListView, :taskListView, :window > > def mouseDown(event) > if event.clickCount > 1 then > puts "I've detected a double-click." > end > end > end > > Alas, it works, but only on every part of the window BUT the two > Views that I want it to work on! I don't care if I've double- > clicked the border of the window, after all. :) What am I missing > here? > |