|
|
Sheet to prompt for (string) information
|
|
|
|
Dedicated MacNNer
Join Date: Apr 2004
Status:
Offline
|
|
I've got a little option to save "themes" in my application, but I'm not really saving them to files... still, I'd like to be able to prompt for a name (NOT filename) to save the theme as. It seems to me that it would be ideal to use a sheet.
So, what I'm asking is, what's the best way to get a sheet to use to prompt for a string?
Is there a class or function (hopefully Cocoa) that I can call? (similar to NSBeginAltertSheet)
Or should I maybe create my own panel via code to use? (possibly using NSGetAlertPanel as a starting point)
Or should I load the panel from a nib file? (in which case, should I put it in the same nib as the rest of the preferences, or in it's own?)
Thanks!
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Take a look at -[NSApplication beginSheet:modalForWindow:modalDelegate:didEndSele ctor:contextInfo:].
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Apr 2004
Status:
Offline
|
|
Originally Posted by Chuckit
Take a look at -[NSApplication beginSheet:modalForWindow:modalDelegate:didEndSele ctor:contextInfo:].
So I should create my own panel then? should it be done with IB or via code?
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Nov 2001
Location: State of Denial
Status:
Offline
|
|
|
[Wevah setPostCount:[Wevah postCount] + 1];
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
I'd do it in IB, but as long as both ways work, I don't think it matters very much except which works for you.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Apr 2004
Status:
Offline
|
|
ended up doing it in my code... has a couple advantages, (I think), one of which is that I can get a reference to the text field without looping through the objects in the sheet and without specifying a global controller variable to point to it. The other is that, by using NSGetAlertPanel (or whatever the function is), I can simply create a text view and stick it in.. the addSubview and removeFromSuperview methods even take care of memory management on my text view...
Thanks guys!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|