Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide close/minimize/maximize button in NSWindow #25

Open
tommycarpi opened this issue Oct 9, 2022 · 1 comment
Open

Hide close/minimize/maximize button in NSWindow #25

tommycarpi opened this issue Oct 9, 2022 · 1 comment

Comments

@tommycarpi
Copy link

I've been trying to remove/hide the 3 top-left buttons of the view (close, minimize and maximize, but I stuck.

This is my current code, not working ...

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
#if targetEnvironment(macCatalyst)
    Dynamic(self.view.window?.nsWindow).standardWindowButton(0).isHidden = true
    Dynamic(self.view.window?.nsWindow).standardWindowButton(1).isHidden = true
    Dynamic(self.view.window?.nsWindow).standardWindowButton(2).isHidden = true
#endif
}

Did anyone manage to solve this?

@forlayo
Copy link

forlayo commented Jul 7, 2023

You can achieve this over a NSWindow setting the style mask https://developer.apple.com/documentation/appkit/nswindow/stylemask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants