Re: Program Generation of Mathematica Code
- To: mathgroup at smc.vnet.net
- Subject: [mg106463] Re: Program Generation of Mathematica Code
- From: David Reiss <dbreiss at gmail.com>
- Date: Wed, 13 Jan 2010 05:59:42 -0500 (EST)
- References: <hihglb$fej$1@smc.vnet.net>
I am not completely sure I understand your question (also Cats and Dogs seemed not to be mentioned in the problem statement). But perhaps this is what you are looking for: PopupMenu[x, MapIndexed[(#2[[1]] -> #1) &, {labelA, labelB, labelC}]] --david http://scientificarts.com/worklife On Jan 12, 4:50 am, "Stewart Bodzin" <Stewart.Bod... at usa.net> wrote: > I cannot figure out how to create a symbol which contains a valid list of > values and labels to use in a PopupMenu. > > In the following example, the list is for cat and dog. I need to generate a > list, represented by a symbol, and use the symbol within the PopupMenu > function. > > I have a list of labels called mylabels. How can I use it in the PopupMenu > with the values of 1, 2, . for the values? > > The symbol Mylabels = {labelA, labelB, labelC} > > needs to be used to create a new symbol that will work as { } > > If the values and the arrows are set to be strings, then it does not work. > > Any ideas would be greatly appreciated.