Custom Sheets
Custom Sheets
- Subject: Custom Sheets
- From: Seth Willits <email@hidden>
- Date: Tue, 29 Jul 2003 10:34:11 -0700
What are the steps to creating a custom sheet? When a button is clicked
I want to display a custom modal sheet where a user can enter some data
into a text field, but I can't figure out how make a sheet in Interface
Builder. I created an NSWindow instance attempted to use that with the
code below, but it says that the window needs to be modal. I'm looking
around in the documentation and can't find anything (obviously I'm
missing it) and there aren't any examples I can find.
- (void)showCustomSheet: (NSWindow *)parentWindow
{
[NSApp beginSheet: sheetWindow
modalForWindow: parentWindow
modalDelegate: nil
didEndSelector: nil
contextInfo: nil];
[NSApp runModalForWindow: sheetWindow];
// Sheet is up here.
[NSApp endSheet: sheetWindow];
[sheetWindow orderOut: self];
}
Also, I assume I should be using a custom NSWindowController to display
and handle the sheet when it's closed. Is this correct, or is there
another way? (I'm new to Cocoa)
Right now, my button calls a function in a controller class which then
tells the sheet's window controller that the sheet should display and
return a value.
Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software -
http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine -
http://www.rbdeveloper.com
Webmaster for REALbasic Game Central -
http://www.freaksw.com/rbgames
"Life without love is like a tree without blossoms or fruit."
-- Kahlil Gibran
------------------------------------------------------------------------
---
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.