Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mycompuser

macrumors member
Original poster
May 8, 2012
37
0
Hi All,

I am developing an mac application. And in one of the use cases, I prompt for an window with an OK button. I want the user to respond to the OK button on the window to close the window.
I have unchecked the "Close" option in the xib which disables the close option in the UI.

But if the user were to hit "Command + w" key when the window has focus, the window closes.
Is there a way by which I can ignore this command so that the window remains opened?

Tried implementing "windowShouldClose" delegate method, but found that this method does not get called at all. The documentation too says that this method is not reliable.
 
Hi

You might get a better response by posting this in the Mac Programming section.

I'm no expert, but assuming your window is a normal NSPanel or NSWindow then you just need to deselect "Close" as shown in the screenshot.
 

Attachments

  • window.png
    window.png
    124.9 KB · Views: 107
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.