1

I would like to add a font style for the variable z in my Slider control below. In this toy manipulate example when the user changers the SetterBar or Slider values, the y slider is reset to y=0.1. Of course I can wrap the z Slider control with Row[{Style["Z",Bold], {z, Slider ....}], but then I need to somehow suppress the appearance of z. Thanks in advance for any help.

Brian

Manipulate[
Module[{}, {x, y, z}], {x, 
SetterBar[Dynamic[x, (x = #; y = 0.1) &], {"A", "B", "C"}] &}, {z, 
Slider[Dynamic[z, (z = #; y = 0.1) &], {.1, 10}, 
Appearance -> "Labeled"] &},
{{y, 0.1, Style["Y", 14]}, 0.1, 5, Appearance -> "Labeled"}, 
Initialization :> ({x, z} = {"B", 1})]
4

1 回答 1

1

做我认为你要求的最简单的方法是使用{{u, uinit, ulbl}, ...}你已经在规范表单中使用的控制规范表单y。例如:

Manipulate[
 Module[{}, {x, y, z}],
 {x, SetterBar[Dynamic[x, (x = #; y = 0.1) &], {"A", "B", "C"}] &},
 {{z, .1, Style["Z", Darker@Green, Bold, 16, FontFamily -> Times]}, 
  Slider[Dynamic[z, (z = #; y = 0.1) &], {.1, 10}, 
    Appearance -> "Labeled"] &},
 {{y, 0.1, Style["Y", 14]}, 0.1, 5, Appearance -> "Labeled"},
 Initialization :> ({x, z} = {"B", 1})]

如果您想避免这种情况,这不需要对您的表达进行太多重组...

于 2013-02-19T23:44:14.023 回答