Assuming the nib file is set up normally, with file's owner class being set
to your controller, and its window outlet connected to the window, and the
window's delegate outlet connected to it:
MyController * mc = [MyController initWithWindowNibName: @"MyNib owner:
self];
int ret = [mc doModalDialog];
[[mc window] orderOut: self];
if (ret == ...)
...
[mc release];
And from within your controller, when you wish to end the modal event
processing:
[NSApp stopModalWithCode: NSRunStoppedResponse];
Or
[NSApp stopModalWithCode: NSRunAbortedResponse];
Where of course the code will be returned by the doModalDialog method.
Note that you really probably want the orderOut and release within the
controller logic and not put that responsibility on clients of the dialog.
That first block of code above, I typically put into a class method on the
controller itself, so that clients call, for instance [mController
doMyDialog];
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden