Re: Custom Sheets
Re: Custom Sheets
- Subject: Re: Custom Sheets
- From: John Lombardo <email@hidden>
- Date: Wed, 30 Jul 2003 02:04:06 +0800
For some wholesome sheety goodness, check out Mike Beam's tutorial:
http://www.macdevcenter.com/pub/a/mac/2001/10/05/cocoa.html
There's a lot to learn at macdevcenter.com
Cheers,
john
On 30/7/03 1:34 AM, "Seth Willits" <email@hidden> wrote:
>
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.
_______________________________________________
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.