I'm writing a MonoMac app and I'm struggling with the BeginSheet. I have a number of problems with it, and will list them in the hope that it is a common problem across them all.
I have managed to get my BeginSheet to show my Login Window as a sheet, but if I set my app's main interface to the MainWindow in the app's properties, instead of the MainMenu, then the BeginSheet does nothing. My delegate also never runs after the sheet closes. I close the LoginWindow from within the LoginDialogController by calling Close().
This is the code that I use on my MainWindowController:
public override void WindowDidLoad ()
{
base.WindowDidLoad ();
Dialogs.LoginDialogController loginDialog = new Dialogs.LoginDialogController();
loginDialog.Window.IsVisible = false;
NSApplication.SharedApplication.BeginSheet(loginDialog.Window, Window, delegate {
// THIS NEVER RUNS
mainTabView.SelectAt(1);
mainToolbar.SelectedItemIdentifier = "hometoolbaritem";
});
}
In one of my other views I use the following code which has absolutely no effect:
TypeDialogController typeDialog = new TypeDialogController();
typeDialog.Window.IsVisible = false;
// THIS CALL HAS NO EFFECT
NSApplication.SharedApplication.BeginSheet(typeDialog.Window, View.Window, delegate {
// THIS WILL PROBABLY NOT RUN EITHER, EVEN IF THE SHEET SHOWS
});
Any help would be appreciated.