Is it possible to bind the contents of a text field to the currently selected menu item of a popup button? For example, if I have a popup button with menu items: “First Name” “Middle Initial” and “Last Name” I would like to have “Brad” displayed in the text field when “First Name” is selected and “Bumgarner” when “Last Name” is selected.
I would also like to be able to associate the contents of a text field (different from the above example) with a selected combo box item.
I think doing this using bindings would be much easier than correctly writing the code in applescript. I’ve tried setting things up in IB but so far I haven’t come upon the correct combination of settings.
Thanks in advance,
Brad Bumgarner
I guess by the lack of any response that this can’t be done (or at least nobody knows HOW to do it). Bummer! Trying to get combo boxes and text fields coorelating properly is a real pain in the…
I need for the user to be able to input/add/delete a list of items in a combo box as well as input/display/delete cooresponding data in a text field. I have 3 such combo box/text field relationships in my app. So far, I haven’t been able to get it to work so I will just have to leave that functionality out for now.
Brad Bumgarner, CTA
I came up with something close, but it doesn’t work quite right (popup menus are weird.). I think it’d be easiest if I just let you look at this:
http://files.macscripter.net/bbs/examples/brad-16197.nib.zip
(Note that there are four text fields.)
On that note, I’ll say that you should just use multiple text fields and labels, for your own sake as well as the user’s.
Bruce,
Thanks for your reply. I agree with your assessment of combo boxes. The problems with using multiple text boxes and labels is 1) the labels could be most anything and 2) some entries may have no need of input, some may only need 1 and others may need 5 or 6.
I’m working on an app that will allow me to utilize most (if not all) of Address Book’s available labels/types. The combo boxes are going to be used to allow for multiple phone number entries (beyond the standard home, work, home fax, work fax). I know some people that have at least a dozen different phone numbers (poor bastards, I say) ranging from home land lines and work lines to fax numbers, cell phones (for both home AND work) and pagers, etc., etc.
BTW, the apps I write are primarily for myself. I know there are products available that already do the kind of thing that I’m working on; I like to exercise my scripting abilities in order to improve them.
Thanks again,
Brad Bumgarner, CTA
p.s.: I already utilitized popups in a table. Works sweet. Combo boxes anywhere, on the other hand, are a whole different ball-o-wax.
I think I have a better understanding of what your looking for. tell me if I’m right.
You want to have just a combo box (to allow for custom entries) and a text field, and you would like the text field to automatically show the value for the currently select label. Thus, you need a way to change the “Model Key Path” for the text field’s “value” binding.
I’m unaware of any way to do that.
Yup, that’s what I’m looking to do. I don’t know of any way to do it either.:rolleyes:
Thanks,
Brad Bumgarner, CTA