Bug introduced in 10.1.0 and fixed in 10.2.0
I've confirmed, with WRI, that an issue was introduced in version 10.1 with regard to initializing Manipulator Dynamic
values when the Manipulator
is wrapped in a DialogInput
.
Here, I'm asking for help in creating a work-around. The slightly modified code snippets I've included are from a larger notebook. But, they show the issue.
The following code shows the initialization of the Manipulator
when not wrapped within a DialogInput
:
DynamicModule[{val = 75.0},
Print[val]; (* Print for Debug *)
Column[{Manipulator[Dynamic[val], {50, 100, 0.2},
Appearance -> {"Open", "Labeled"},
AppearanceElements -> {"InputField", "StepLeftButton", "StepRightButton"}]}]
]
The above works fine with the Manipulator
being initialized to 75.
, even in version 10.1.
The following is the code that will not propagate the initialization value to the Manipulator
inside a DialogInput
using version 10.1, but worked in prior versions. Note that the Manipulator
is initialized to 50.
, not 75.
:
DynamicModule[{val = 75.0},
DialogInput[
Print[val]; (* Print for Debug *)
Column[{Manipulator[Dynamic[val], {50, 100, 0.2},
Appearance -> {"Open", "Labeled"},
AppearanceElements -> {"InputField", "StepLeftButton", "StepRightButton"}],
Row[{DefaultButton[DialogReturn[{Today, Round[val, 0.2]}]], CancelButton[]}]}],
WindowTitle -> "Input Value"]
]
In the actual code, the initialization value for val
is from a file, not hard-coded. Can anyone think of a work-around that will allow me to get an initialization value into the Manipulator
that works in version 10.1? It may not be possible, but I'm looking for something relatively simple that doesn't require modifying any system files.
To address some questions in the comments:
I should have mentioned that I'm running Win 8.1, 64-bit. Maybe it's specific to that OS version. I did get confirmation from WRI that they were able to reproduce my problem.
The purpose of the code is simply to be able to open a DialogInput
with a slider initialized to a piece of data read from a file. If desired, manipulate the slider to a new value and return that value along with the date. If my current approach is not a good one, I'm open to better ideas.
Comments
Post a Comment