1
votes

I created a MonoMac project with monodevelop.

I opened the file MainWindow.xib in the Xcode Interface Builder. In Interface Builder, I dropped a new NSwindow Panel into my project. The panel name is: Setting_window and the outlet name is: Setting_window.

In the Mainwindow I have 2 buttons: Hide Settings Window(btn1) and Show Settings Window(btn2);

When I run project, It show 2 window : Main Window and Settings window. I want to hide and show Settings window when click button btn1 and btn2. In C# on Windows, I use .show() and .Dispose(); But on Monomac, I don't know which methods to call.

This is code:

Setting_window.Title = "my setting"; // This works as expected 
//Setting_window.??? // I want to close the settings window
1

1 Answers

1
votes

NSWindow.Close() was not available due to how it released the reference on the objc side of things, and wasn't playing nice with the GC.

It appears that a recent fix has been committed that brings back this method so you can close the window programatically:

https://github.com/mono/monomac/commit/6183d93be442aec3946f19e273e4810dff291f66