cocoa sheets
cocoa sheets
- Subject: cocoa sheets
- From: Robert Goldsmith <email@hidden>
- Date: Fri, 9 Nov 2001 00:05:12 +0000
Hi all :)
I know this has prob been answered before but I can't find the answer anywhere:
what is the correct way to close a sheet?
I have a window I have designed in IB in my nib and I open it with
the NSApp call beginSheet: modalForWindow: modalDelegate:
didEndSelector: contextInfo:
This works fine. Now, my sheet has two buttons. I have looked for
default connections for these buttons (ok and cancel) but there seem
to be none so I've connected them to actions in the windows delegate.
This works fine. However, when either of these buttons are pressed, I
want to close the sheet. I have tried using the close method but,
although this works to remove the sheet, it does not stop the modal
operation NSApp is in and it beeps at me.
Any suggestions?
On a side note, I also can't find a way in IB to set the cancel
button to being the default (blue, throbbing). Do I have to do this
in code or can it be done in IB?
Thanks
Robert
--