Re: Re: Manipulate: Positioning of controls within panel
- To: mathgroup at smc.vnet.net
- Subject: [mg89699] Re: [mg89661] Re: Manipulate: Positioning of controls within panel
- From: John Fultz <jfultz at wolfram.com>
- Date: Wed, 18 Jun 2008 04:25:49 -0400 (EDT)
- Reply-to: jfultz at wolfram.com
Manipulate encompasses both Dynamic and DynamicModule functionality. With the default option of LocalizeVariables->True, all of the Manipulate variables which are mapped to controls are scoped within a DynamicModule and maintain all of the advantages you correctly point out of using a DynamicModule directly. Manipulate also takes advantage of DynamicModule's Initialization and Deinitialization options in order to implement Manipulate's version of those options. Sincerely, John Fultz jfultz at wolfram.com User Interface Group Wolfram Research, Inc. On Tue, 17 Jun 2008 00:36:40 -0400 (EDT), Januk wrote: > Hi David, > > One point of clarification, your post implies that DynamicModule and > Manipulate provide overlapping functionality. They do not. In very > basic terms: > -- Manipulate is a relatively quick and easy way to create Dynamic > objects and to create an interactive interface. > -- DynamicModule is a way of localizing symbols and data to an object > in a notebook. > > So, Manipulate and DynamicModule do not provide overlapping > functionality. In fact, often you might want to use a Manipulate > inside a DynamicModule. See the Mathematica Demonstrations websites > for many examples of exactly this. > > In your example, the DynamicModule command could be eliminated and > you'd still have something that works like a Manipulate. The > DynamicModule wrapper simply allows the a1 and a2 symbols to be > localized and stored in the DynamicModule object rather than in the > session. What this means is that, with the DynamicModule, you could > quit your kernel and still interact with the output. This is very > useful if you want to create an application for other users, but want > to limit their exposure to Mathematica code. You can create a > DynamicModule and then give them a notebook with only the one output > cell that contains the DynamicModule. > > Hope that helps, > Januk > > > On Jun 14, 5:31 am, "David Park" <djmp... at comcast.net> wrote: >> Rather than use a Manipulate, which is convenient for many cases but not >> very customizable, why not directly use a DynamicModule. It's really not >> that difficult and when you customize it's really much easier. >> >> Here is an example. We create a Column that has a title row, an input >> row, >> and a results row. You could actually have a more fancy Grid structure >> that >> might include all kinds of input controls, plots and outputs. >> >> DynamicModule[ >> {a1=False,a2=False}, >> Column[{ >> Style["Some Common Logic Operations",16,"Panel",Background->None], >> Row[{"a1: ",Checkbox[Dynamic[a1]],Spacer[20],"a2: >> ",Checkbox[Dynamic[a2]]}], >> Dynamic@Row[{"a1"\[And]"a2: ",a1\[And]a2,Spacer[10],"a1"\[Or]"a2: >> ",a1\[Or]a2,Spacer[10],"Nor[a1, a2]: ",Nor[a1,a2]}]//TraditionalForm}](* >> Column *) >> >> ] >> >> -- >> David Park >> djmp... at comcast.nethttp://home.comcast.net/~djmpark/ >> >> "H Hogreve" <hogr... at ifisr.org> wrote in message >> >> news:g2th9g$7m9$1 at smc.vnet.net... >> >> >>> Probably it is not a difficult task, but unfortunately >>> I cannot figure out how to place two (or more) controls >>> into the same line in the panel of manipulate. For example, >>> in >>> >>> Manipulate[{a1, a2}, {a1, {True, False}}, {a2, {True, False}}] >>> >>> it certainly makes sense to have the two Checkboxes >>> aligned in one horizontal line. But, while outside >>> manipule the command >>> >>> Row[Table[Checkbox[], {i, 1, 2}]] >>> >>> yields two Checkboxes in a line, I did not succeed making >>> something similar work in manipulate. >>> Any help will be appreciated. >>> >>> Many thanks in advance, H. Hogreve- Hide quoted text - >>> >> - Show quoted text -