MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: SetOptions does not work with Grid

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115994] Re: SetOptions does not work with Grid
  • From: Armand Tamzarian <mike.honeychurch at gmail.com>
  • Date: Fri, 28 Jan 2011 06:16:17 -0500 (EST)
  • References: <igmcri$5e$1@smc.vnet.net> <ih3rdm$bgu$1@smc.vnet.net> <ihbjp4$deu$1@smc.vnet.net>

On Jan 21, 8:31 pm, Armand Tamzarian <mike.honeychu... at gmail.com>
wrote:
> On Jan 20, 10:32 pm, AES <sieg... at stanford.edu> wrote:
>
>
>
> > In article <ih6eb4$3d... at smc.vnet.net>,
> >  Armand Tamzarian <mike.honeychu... at gmail.com> wrote:
>
> > > As it happens I just asked tech support today why SetOptions doesn't
> > > work with Grid (or Column) but does work with Row. The answer was tha=
t
> > > Row is a RowBox and Grid and Column are GridBoxes. "GridBox does not
> > > support SetOptions"
>
> > > In other words it doesn't work because SetOptions isn't supported but
> > > no explanation of why SetOptions isn't, or can't be, supported.
>
> > > Interestingly to demonstrate this behaviour of GridBox the response
> > > was first to Options[GridBox], to show the options, then
> > > SetOptions[GridBox] to get the message. Then do the same for RowBox.
>
> > > When you do that you see that the system tells you GridBox has option=
s
> > > but you cant SetOptions (you get a message), whereas RowBox doesn't
> > > have options (empty list) but you can SetOptions!
>
> > Just a few more additions to Mathematica's extensive "gotcha!" list
> > (or, as someone else started calling them -- and it's a great label --
> > "Today's WTF" list.
>
> The irritating thing in this case is the lack of any messages advising
> the usage of SetOptions is futile. Sure there is a message for GridBox
> but not for Grid, which is the Head most people will be trying to
> SetOptions for (not the underlying GridBox).
>
> Additionally there does not seem to be a source or list of what
> SetOptions works on and what it doesn't work on. Nothing in the
> SetOptions documentation. The place to spell this out to users is,
> IMO, in the More Information part of the documentation for a function/
> Option etc.
>
> I'm also finding that many control elements cannot have their options
> set using SetOptions.
>
> Mike

I got this list from tech support of all box types that do not support
SetOptions:

"ActionMenuBox", "AnimatorBox", "CheckboxBox", "ColorSetterBox", \
"CounterBox", "DynamicBox", "DynamicModuleBox", "DynamicWrapperBox", \
"GridBox", "InputFieldBox", "ItemBox", "Line3DBox", "LineBox", \
"LocatorBox", "LocatorPaneBox", "OpenerBox", "OptionValueBox", \
"OverlayBox", "PaneBox", "PanelBox", "PaneSelectorBox", "Point3DBox",
\
"PointBox", "PopupMenuBox", "ProgressIndicatorBox", "RadioButtonBox",
\
"RectangleBox", "RotationBox", "SetterBox", "Slider2DBox", \
"SliderBox", "TabViewBox", "TemplateBox", "TogglerBox", "TooltipBox",
\
"ValueBox"

>From this we can work out what functions don't support SetOptions.
This should obviously be documented. Additionally because you don't
necessarily get an error message when you use SetOptions -- see Grid
example in this thread -- the user is left none the wiser as to why
things aren't working -- until they contact tech support or read this
thread. So in additional to explicitly stating in the function
documentation that SetOptions doesn't work it might help is a message
is generated when it is used on a function for which it doesn't work.

Mike


  • Prev by Date: Re: Help with While Loop Function
  • Next by Date: Re: a bug in Mathematica 7.0?
  • Previous by thread: Re: SetOptions does not work with Grid
  • Next by thread: Parallel functions in version 8