Skip to main content
added 86 characters in body
Source Link
Michael E2
  • 244.7k
  • 18
  • 350
  • 774

Wrap the Background setting in Dynamic. The variables in the Background option seem to need to be global. Either like this:

background = 1;
Manipulate[{}, {m, 1, 10}, 
 Grid[{{Dynamic[background = m; 
     Plot[Sin[x], {x, -m, m}, ImageSize -> 200, Frame -> True, 
      ImagePadding -> 30]]}}], Paneled -> False, ContentSize -> {0}, 
 Frame -> False, Alignment -> Center, 
 AppearanceElements -> "ManipulateMenu", 
 BaseStyle -> {Background :> Dynamic@Hue[(background - 1)/9]}]

or perhaps like this:

Manipulate[{}, {m, 1, 
  10}, {{background, background = RGBColor[.80, .80, .90]}, 
  ColorSlider},
 Grid[{{Dynamic[
     Plot[Sin[x], {x, -m, m}, ImageSize -> 200, Frame -> True, 
      ImagePadding -> 30]]}}], Paneled -> False, ContentSize -> {0}, 
 Frame -> False, Alignment -> Center, 
 AppearanceElements -> "ManipulateMenu", LocalizeVariables -> False, 
 BaseStyle -> {Background :> Dynamic@Hue[(m - 1)/9]Dynamic@background}]

Wrap the Background setting in Dynamic. The variables in the Background option seem to need to be global. Either like this:

background = 1;
Manipulate[{}, {m, 1, 10}, 
 Grid[{{Dynamic[background = m; 
     Plot[Sin[x], {x, -m, m}, ImageSize -> 200, Frame -> True, 
      ImagePadding -> 30]]}}], Paneled -> False, ContentSize -> {0}, 
 Frame -> False, Alignment -> Center, 
 AppearanceElements -> "ManipulateMenu", 
 BaseStyle -> {Background :> Dynamic@Hue[(background - 1)/9]}]

or like this:

Manipulate[{}, {m, 1, 10}, 
 Grid[{{Dynamic[
     Plot[Sin[x], {x, -m, m}, ImageSize -> 200, Frame -> True, 
      ImagePadding -> 30]]}}], Paneled -> False, ContentSize -> {0}, 
 Frame -> False, Alignment -> Center, 
 AppearanceElements -> "ManipulateMenu", LocalizeVariables -> False, 
 BaseStyle -> {Background :> Dynamic@Hue[(m - 1)/9]}]

Wrap the Background setting in Dynamic. The variables in the Background option seem to need to be global. Either like this:

background = 1;
Manipulate[{}, {m, 1, 10}, 
 Grid[{{Dynamic[background = m; 
     Plot[Sin[x], {x, -m, m}, ImageSize -> 200, Frame -> True, 
      ImagePadding -> 30]]}}], Paneled -> False, ContentSize -> {0}, 
 Frame -> False, Alignment -> Center, 
 AppearanceElements -> "ManipulateMenu", 
 BaseStyle -> {Background :> Dynamic@Hue[(background - 1)/9]}]

or perhaps like this:

Manipulate[{}, {m, 1, 
  10}, {{background, background = RGBColor[.80, .80, .90]}, 
  ColorSlider},
 Grid[{{Dynamic[
     Plot[Sin[x], {x, -m, m}, ImageSize -> 200, Frame -> True, 
      ImagePadding -> 30]]}}], Paneled -> False, ContentSize -> {0}, 
 Frame -> False, Alignment -> Center, 
 AppearanceElements -> "ManipulateMenu", LocalizeVariables -> False, 
 BaseStyle -> {Background :> Dynamic@background}]
Source Link
Michael E2
  • 244.7k
  • 18
  • 350
  • 774

Wrap the Background setting in Dynamic. The variables in the Background option seem to need to be global. Either like this:

background = 1;
Manipulate[{}, {m, 1, 10}, 
 Grid[{{Dynamic[background = m; 
     Plot[Sin[x], {x, -m, m}, ImageSize -> 200, Frame -> True, 
      ImagePadding -> 30]]}}], Paneled -> False, ContentSize -> {0}, 
 Frame -> False, Alignment -> Center, 
 AppearanceElements -> "ManipulateMenu", 
 BaseStyle -> {Background :> Dynamic@Hue[(background - 1)/9]}]

or like this:

Manipulate[{}, {m, 1, 10}, 
 Grid[{{Dynamic[
     Plot[Sin[x], {x, -m, m}, ImageSize -> 200, Frame -> True, 
      ImagePadding -> 30]]}}], Paneled -> False, ContentSize -> {0}, 
 Frame -> False, Alignment -> Center, 
 AppearanceElements -> "ManipulateMenu", LocalizeVariables -> False, 
 BaseStyle -> {Background :> Dynamic@Hue[(m - 1)/9]}]