Skip to main content
Tweeted twitter.com/StackMma/status/1354987688508743682
added 165 characters in body
Source Link
Mike Honeychurch
  • 37.8k
  • 3
  • 87
  • 161

Not all functions seem to work with SetOptions. e.g.

SetOptions[Grid, BaseStyle -> Directive[Red]];
Grid[{{"hello", "world"}}]

hello world

the font is not red.

SetOptions[Row, BaseStyle -> Directive[Red]];
Row[{"hello", "world"}]

hello world

...and the font is red.

enter image description here

SetOptions[InputField, FieldSize -> 5];
InputField[Dynamic[x]]

the input field size is much larger than 5. But on the other hand

InputField[Dynamic[x], Sequence @@ Options[InputField]]

yields an input field with field size 5.  

enter image description here

...and so on.

What is the easiest way to work out (i.e. make a list of ...) which functions can't be used with SetOptions?

Not all functions seem to work with SetOptions. e.g.

SetOptions[Grid, BaseStyle -> Directive[Red]];
Grid[{{"hello", "world"}}]

hello world

the font is not red.

SetOptions[Row, BaseStyle -> Directive[Red]];
Row[{"hello", "world"}]

hello world

...and the font is red.

SetOptions[InputField, FieldSize -> 5];
InputField[Dynamic[x]]

the input field size is much larger than 5. But on the other hand

InputField[Dynamic[x], Sequence @@ Options[InputField]]

yields an input field with field size 5.  ...and so on.

What is the easiest way to work out (i.e. make a list of ...) which functions can't be used with SetOptions?

Not all functions seem to work with SetOptions. e.g.

SetOptions[Grid, BaseStyle -> Directive[Red]];
Grid[{{"hello", "world"}}]

hello world

the font is not red.

SetOptions[Row, BaseStyle -> Directive[Red]];
Row[{"hello", "world"}]

hello world

...and the font is red.

enter image description here

SetOptions[InputField, FieldSize -> 5];
InputField[Dynamic[x]]

the input field size is much larger than 5. But on the other hand

InputField[Dynamic[x], Sequence @@ Options[InputField]]

yields an input field with field size 5.

enter image description here

...and so on.

What is the easiest way to work out (i.e. make a list of ...) which functions can't be used with SetOptions?

edited title
Link
Mike Honeychurch
  • 37.8k
  • 3
  • 87
  • 161

How can I work out which functions work with `SetOptions`SetOptions?

Source Link
Mike Honeychurch
  • 37.8k
  • 3
  • 87
  • 161

How can I work out which functions work with `SetOptions`?

Not all functions seem to work with SetOptions. e.g.

SetOptions[Grid, BaseStyle -> Directive[Red]];
Grid[{{"hello", "world"}}]

hello world

the font is not red.

SetOptions[Row, BaseStyle -> Directive[Red]];
Row[{"hello", "world"}]

hello world

...and the font is red.

SetOptions[InputField, FieldSize -> 5];
InputField[Dynamic[x]]

the input field size is much larger than 5. But on the other hand

InputField[Dynamic[x], Sequence @@ Options[InputField]]

yields an input field with field size 5. ...and so on.

What is the easiest way to work out (i.e. make a list of ...) which functions can't be used with SetOptions?