osx - How do I open a window as a modal dialog in MonoMac using C#? -
i developing cocoa application monomac (c#).
i have class mywindowcontroller inherits monomac.appkit.nswindowcontroller, , open new instance of window this:
mywindowcontroller mwc = new mywindowcontroller(); mwc.window.makekeyandorderfront(this); but how open modal dialog? imperative nothing else in application executed while dialog open, cannot use window sheet (which blocks current window). , can't find else seems want on controller. on windows, have done calling:
mwc.showdialog(); so want monomac equivalent of showdialog(), believe.
i spent 3 hours trying figure out before posting question, of course found solution right after asking.
it looks need use nsapplication object:
nsapplication.sharedapplication.runmodalforwindow(ewc.window);
Comments
Post a Comment