I want to use a pair of sliders to set integer values ββfor two variables nLo and nHi , each of which can vary from 1 to 100, but subject to the limitation nHi> = nLo . Therefore, I adjust the slider for each variable that has a range that dynamically depends on another variable:
nLo = 1; nHi = 100; Column[ { Labeled[Slider[Dynamic[nLo], {1, Dynamic[nHi], 1}, Appearance -> "Labeled"], "nLo", Left ], Labeled[Slider[Dynamic[nHi], {Dynamic[nLo], 100, 1}, Appearance -> "Labeled"], "nHi", Left ], Dynamic[{nLo, nHi}] } ]
The problem is that as soon as I adjust nHi , its value becomes real (displayed with a decimal point), and not an integer. I believe this is because the slider for nHi cannot say that its first argument to the range Dynamic [nLo] is actually an integer and therefore it uses real values ββby default. Any suggestions on how to get nHi to remain integer? (Linux Mathematica v8.0.1)
source share