Message Boards Message Boards

NotebookObject and SetOptions vs non-object expressions

I recently learned that you can use SetOptions to display or hide a notebook. Simple example:

nb = CreateDocument[{"nothing"}];
SetOptions[nb, Visbile->False]

This is great, it's how I'd like to set options on a lot of UI elements. But unfortunately, this is not a general construct

input = InputField[Dynamic[x],String]
SetOptions[input, FieldSize->Large]

That fails. So is there an easy way to treat UI elements like InputField, PopupMenu, etc as an object by adding some "object wrapper".

I realize there are ways around this, but they're messy. One way to do this post hoc update is to do something like

AppendTo[input, FieldSize->Large]

But if FieldSize already exists in the expression then you need to do a replace and it gets ugly.

POSTED BY: Eric Smith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract