Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another newbie question



Comrades:

Hi, its me again.

My interface consists (mostly) of a bunch of popup buttons with various values in them. Out user will set up all these popups and click "go", and the app will emit a string which can be used to run a command line program. So, for example we have a couple of popups like:

Color
-black
-red
-green
-blue

Size
-small
-medium
-large

So, lets say that the command line wants something like:
	"runfoo -color 2 -size 1"

and that the "runfoo" help file says
	-color : red = 1, blue = 2, green = 3, black = 4, default = 4
	-size : small = 1, medium = 2, large = 3, default = 3

So, here is my question. What is the best way to translate between the popup item and the value? I was thinking of building an NSDictionary with item_string_key/command_line_argument_value pairs, but I realized that I have a bunch of different "default" values (color default = 4, size default = 3).

I guess I could have a dictionary for each popup, but that seems clunky. I see there is something called "Bindings" for menu/popup items, is that a way to go? (I am trying not to put the info in the NIB, I would prefer code, where I can see it.)




Paul Archibald


--------------------------------------------------
"The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague."


Edsger W. Dijkstra, (Dutch computing scientist)
---------------------------------------------------



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.