views:

191

answers:

1

My app displays an NSWindow as a sheet. The NSWindow has various controls for settings properties of an object (an NSTextfield, a NSDatepicker etc) and two NSButton's, 'Add' and 'Cancel' which are used to confirm or cancel the action.

I have set the key equivalent of the 'Add' button to enter and the key equivalent of Cancel to escape. This does not have the desired affect. I think this is due to the other controls handling the keypress events.

How do I configure my sheet so that the buttons behave as described?

+1  A: 

The solution is to not just check your work, but to double check it!

The setup as described in the question works perfectly. (I have two similar sheets and I was using the wrong one.)

Benedict Cohen