Bug 6067 - Unable to override MouseDown method on NSOutlineView due to NSTableView new event of same name
Summary: Unable to override MouseDown method on NSOutlineView due to NSTableView new e...
Status: RESOLVED FIXED
Alias: None
Product: MonoMac
Classification: Desktop
Component: Bindings ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2012-07-10 17:00 UTC by Chris Hamons
Modified: 2014-01-14 14:28 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Chris Hamons 2012-07-10 17:00:00 UTC
NSControl defines a method MouseDown that I'd like to override in my subclass of NSOutlineView. However, NSTableView declares an event with the same name as "new". I can't override the base method, even after trying NSControl.MouseDown.

Please rename one or the other.
Comment 1 Martin Baulig 2012-08-15 15:51:33 UTC
I renamed NSTableView's MouseDown to MouseDownInHeaderOfTableColumn (which also matches the objective C name more closely).
Comment 2 Herman Schoenfeld 2012-09-11 03:53:03 UTC
This also occurs in NSTableView.

Workaround in your subclass	

		[Export("mouseDown:")]
		public new void MouseDown(NSEvent theEvent) {

			// your code here ...
		
			((NSResponder)this).MouseDown(theEvent);
		}
Comment 3 Miguel de Icaza [MSFT] 2012-09-11 08:44:19 UTC
Martin, can you fix this one too?
Comment 4 Martin Baulig 2012-09-11 12:16:47 UTC
Yeah sure.

I think I'll write some simple reflection tool to scan over the entire API, there are likely a few other cases as well.
Comment 5 Martin Baulig 2012-10-29 11:08:40 UTC
Just looked at this and I can't find any "MouseDown" in NSTableView.
Comment 6 Chris Hamons 2012-11-15 11:29:12 UTC
It's on the base class NSControl.
Comment 7 Chris Hamons 2014-01-14 14:28:50 UTC
Looks fixed. Since I filed the bug myself, closing.
Comment 8 Chris Hamons 2014-01-14 14:28:51 UTC
Looks fixed. Since I filed the bug myself, closing.