0

I'm a PC guy taking his first shot at Mac. I'm building a Cocoa desktop app with Visual Studio for Mac, Xamarin.Mac, Xcode, .Net and C#.

The app consists in a home window with additional windows the user can select using menu items I added to the standard Mac app menu.

I'd like to close the active window when the user selects a new window. I can't find the line of code where it says "Open this new window.", where I could say just before "Close active window". Neither in Visual Studio nor Xcode. (So far, the interaction Visual Studio-Xcode is a bit of a black box to me.)

So how do you close a window before opening a new one?

And as a bonus question (if I may): how do I get rid of the close-min-max buttons in a window created from a view controller control. Easy to do with the home window, but I haven't found the way to do it in additional windows.

user13424
  • 111
  • 1
  • 4
  • 1
    So to be clear, when they "select" new window, are they clicking a button or just changing focus? – ScottishTapWater Jan 07 '22 at 18:15
  • As for the bonus question, I've never used Cocoa with C#, but here's how you'd do it in Swift, I'd imagine it's similar https://stackoverflow.com/a/43370575/4700841 – ScottishTapWater Jan 07 '22 at 18:17
  • Finally, have you considered using MAUI? I know it's not an answer to your question but it's the new cross-platform .NET UI Framework from MS and it looks pretty sweet – ScottishTapWater Jan 07 '22 at 18:18
  • 1
    Thanks for your suggestions @Persistence. I'll look into all this. And to answer your question, the user clicks on an app menu item to open the form related to that menu item. – user13424 Jan 08 '22 at 18:26

0 Answers0