[Mono-osx] MonoMac sheets not attached to docWindow on first open

Uli Hertlein uli at xdt.com.au
Sun Dec 18 21:05:26 EST 2011


Hi guys,

this might be more of a pure Cocoa question than anything, but since I'm 
writing this in C#/MonoMac it applies here as well and I'm hoping for 
some expert insight.

I have a MainWindowController (with an NSWindow from .xib) and a 
EditWindowController (with an NSPanel from another .xib) that's supposed 
to slide over the main window as a sheet/modal dialog.

To begin/show the edit sheet I'm calling:

  NSApplication.SharedApplication.BeginSheet(editPanelWindow, 
mainDocWindow, selector, 0);

and close it with:
  editPanelWindow.OrderOut(sender);
  NSApplication.SharedApplication.EndSheet(editPanelWindow, returnCode);

where editPanelWindow is the NSPanel and mainDocWindow is the main window.

The first time the editPanelWindow pops-up almost randomly on the 
screen, not attached to the mainWindow.  Oddly enough after closing and 
re-opening the NSPanel it nicely slides out of the mainWindow title bar 
and is in the right location.

It feels like there's some setup taking place as part of the 
BeginSheet/EndSheet that I'm missing but the docs/tutorials/etc aren't 
helpful...

Cheers,
/uli


More information about the Mono-osx mailing list