[Mono-osx] Problems with C# events and properties on NSWindow

Steve Orth steven.orth at ni.com
Fri Aug 3 20:16:37 UTC 2012

Hi all,

About 6 weeks ago, I filed this bug report (recently updated):


When we updated to the latest version of MonoDevelop (, our 
MonoMac application manifested problems with NIOpenPanel.BeginSheet(). 
I've been able to reproduce the problem in a simple application that 
merely adds (or removes, without adding) an event handler to any* C# event 
on NSWindow. Accessing certain properties also causes the problem. In the 
case of BeginSheet(), you never see the sheet, and your main window moves 
down on the screen. "Dismissing" the sheet via the ESC key restores the 
window to its original position.

* at least, all the ones I've tried

The code I used to break NSOpenPanel.BeginSheet() is in the .zip attached 
to that bug report. I built the same project in MonoDevelop 3.0.2 and, 
rather than having the broken BeginSheet(), you'll see the original 
problem in the bug report -- zooming the window will utterly malfunction 
and "squish" the window off the bottom of the screen.

Though I have confirmed this in-house, confirmation from others would be 
appreciated. Digging into this a bit further reveals that using properties 
/ events on NSWindow renders any custom NSWindowDelegate worthless -- it 
will be replaced via a call to EnsureNSWindowDelegate() -- there is no 
"chaining" of delegates, and it appears there's not a way to opt out of 
the internally provided delegate. Bugs like this are making our work 
increasingly difficult, as we become mistrustful of updates to 
MonoDevelop, and end up struggling to ascertain whether "new" problems are 
due to our own errors or the tools.

Thank you, and best regards,

Steve Orth
National Instruments
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-osx/attachments/20120803/75023703/attachment.html>

More information about the Mono-osx mailing list