Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!bellcore!texbell!texsun!newstop!sun!imagen!atari!portal!portal!cup.portal.com!nicky From: nicky@cup.portal.com (nick john pilch) Newsgroups: comp.sys.mac.programmer Subject: Pop-up menus and MPW scripts Message-ID: <27526@cup.portal.com> Date: 4 Mar 90 02:07:15 GMT Organization: The Portal System (TM) Lines: 35 Two questions: Has anyone else noticed that the horizontal displacement for the start of the text in a pop-up menu changed from 6.0.3 to 6.0.4? Text in a pop-up menu is now drawn about 2 pixels to the left of where it used to be. Those who coded their pop-ups so that the text displayed on their pop-up-at-rest bar corresponded exactly to what would appear in the menu when the menu was clicked find that now the text moves to the left when the pop-up bar is clicked. I didn't see this documented anywhere and it'd be nice to know why this was done. Try out the pop-up menus in the projector windows of MPW or the Set Tabs & Font dialog of THINKC. Secondly, I would like to add some "check-able" menu items to a menu in MPW. They would correspond to exported shell variables whose state is either 1 or 0. For example, one variable is SADESYMBOLS. A value of 1 would mean to compile, lib and link everything with Sade symbols turned on. I'd like to add that item to a menu so that when it's first added, it would be checked if the variable were 1 and unchecked if it were 0. Then, choosing the menu item would toggle its value and the checkmark. I think this has to be done with a script. The script would add the menu item if it weren't there and would be invoked when the menu item were chosen to do the toggling. (CompareFiles works like this.) Anyway, the problem is that I want to be able to pass the variable name to this script and then have the script evaluate the variable. How can I do this? When the script sees the variable as a parameter it just treats it as a string and won't evaluate it no matter what I do. The only way I can see to evaluate it is to say: "Set MyVariableName" and then extract the last part when I get the output, i.e., "Set MyVariableName 0." How do I extract the 0 then? Is there an easier way??? Nick Pilch Mountain Lake Software nicky@cup.portal.com