I am building a large Manipulate application with about 50-60 checkboxes through which the user can select entities to be drawn on a main canvas. The main drawing routine, called from within Manipulate is defined as:

drawingRoutine[param1_,param2_,opts:OptionsPattern[]] := Module[{...},...]

I have two basic questions, referring to getting the data from manipulate controls into a list of options, and backward:

1) Since drawingRoutine[] accepts a large number of switches as optional parameters, what is the right programmatic pattern to go from Manipulate's long list of controls to the options list without writing each by hand.

2) As a convenience, the Manipulate application allows the user to select, via a menu, a particular "view", each of which corresponds to a list of things to draw. I encode these as an association:

viewAssoc = <|

So my second question is, having recovered the options associated with the view selected in the drop-down menu, how do I transfer it to the list of controls within Manipulate in a non-manual way (the latter one has 60+ controls).

Ideally, I could list all the controls in Manipulate as a "Hold" list:

ctrlList = Hold@{ctrl1,ctrl2,ctrl3,...}

However this is not ideal as order would matter. I would like to assign/read/modify control symbols in a programmatic way where all the controls and options are handled as an orderless list. For example, having them be in an association of some kind:


Or perhaps the opposite:


The trick here is what gets evaluated when and how?

Does that make sense?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.