Blanking a SetVariable when grayed-out ?

Folks,

I would like gray out a SetVariable, and not show the SetVariable's value when it is grayed (i.e. I would like to blank the SetVariable when grayed). I've tried changing the foreground text color to be the same as the background color (white, in this case), but this leads to a strange behavior: when disable=0, the text shows up as white on a white background (and so the SetVariable looks blank), but when I set disable=2, the text shows up as gray on a white background. This strikes me as odd. So I guess my first question is: Is this a bug?

My second question is: Can anyone suggest a way to achieve the effect I desire? I suppose I could resort to having the SetVariable's value be an internal string, and then I could set that to the empty string to blank the SetVariable. But then I lose the little up and down arrows (some of my SetVariables hold integer values, so it's nice to have buttons to increment/decrement them), plus I have to deal with validating the string when the user modifies it, and synch'ing the underlying variable and the SetVariable's internal string. So I don't love that solution... Any ideas?

Thanks in advance for any help you can lend,
Adam

adamltaylor wrote:

I would like gray out a SetVariable, and not show the SetVariable's value when it is grayed (i.e. I would like to blank the SetVariable when grayed). ...


I don't know if there is an easy solution beyond disable=2 and working with internal string/number storages for the SetVariable to blank out the value.

A kludge that comes to mind is to create a second SetVariable control with nothing in it, have it positioned exactly in the same place as the primary SetVariable control, and then alternate disable commands on the overlapping SetVariable controls, to the effect ...

HideSetVariables = ... // 0 - show active inputs, 1 - hide active inputs
SetVariable InputToShow, disable=(1-HideSetVariables)
SetVariable BlankToShow, disable=(2*HideSetVariables)


--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
jjweimer's suggestion would certainly work. It strikes me as potentially fragile, especially if your procedure is shared between Mac and PC.

Perhaps something easier to implement would be to alternate between strings and numeric when you disable/enable the control. So when you disable, you would set value=_STR:"" and when you enable, value=root:someglobal where someglobal holds the number of interest. Might as well use the global as the value, since you're going to need a global to store the value while its disabled.

True, while disabled you get no little arrows. But it's blank, and disabled, so maybe it's not so important.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com