Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Sheet to prompt for (string) information

Sheet to prompt for (string) information
Thread Tools
arcticmac
Dedicated MacNNer
Join Date: Apr 2004
Status: Offline
Reply With Quote
Jul 4, 2005, 11:55 AM
 
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!
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jul 4, 2005, 03:23 PM
 
Take a look at -[NSApplication beginSheet:modalForWindow:modalDelegate:didEndSele ctor:contextInfo:].
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
arcticmac  (op)
Dedicated MacNNer
Join Date: Apr 2004
Status: Offline
Reply With Quote
Jul 4, 2005, 05:17 PM
 
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?
     
Wevah
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Jul 5, 2005, 02:20 PM
 
I'd do it in IB.
[Wevah setPostCount:[Wevah postCount] + 1];
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jul 5, 2005, 02:26 PM
 
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'."
     
arcticmac  (op)
Dedicated MacNNer
Join Date: Apr 2004
Status: Offline
Reply With Quote
Jul 7, 2005, 12:07 AM
 
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 Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:48 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,