2

Is there a way to remove the braces from the front end output associated with DynamicModule? For instance:

a=0;
DynamicModule[{x}, {Slider[Dynamic[x]], Dynamic[If[x>.5,a=1;,{}]]}]

This returns a slider with braces around it. Is there a way to avoid or remove the braces?

Kuba
  • 136,707
  • 13
  • 279
  • 740
user8454
  • 353
  • 2
  • 9

1 Answers1

5

Quick fix to your code would be to add Row and Spacer[0].

a=0;
DynamicModule[{x}, Row@{Slider[Dynamic[x]], Dynamic[If[x>.5,a=1;, Spacer[0]]]}]

Instead of Spacer[0] you can use empty string: "", or Invisible[""].

Those braces are in output because you put them there. To know more about organizing an output, take a look at documentation:

tutorial / Grids Rows and Columns overview

there are also interesting related Q&A-s here on Mathematica.SE, for example:

Why use Column with Rows instead of Grid?

Kuba
  • 136,707
  • 13
  • 279
  • 740