# Tag Info

9

The answer is that yes, you can affect the appearance of components of a control but the problem in this case is that your list of appearances appearances = {"DialogBox", "Palette", "FramedPalette", "Frameless"}; are only valid Button appearances and that is why they have no effect of ButtonBar or TabView. When you use valid appearances it works fine: ...

8

You have to study the documentation carefully, but I agree that help-pages like the one of Manipulate are very densely packed with information. In the Details and Options section you find how to set options for controls: {{u,...},...,opts} control with particular options The non-obvious part is, that you have to set the ControlType as well to make ...

7

You can always create your own custom controls. This is a lot of work, but it also gives you unlimited flexibility. You can even create completely new kinds of control. Scroll down to the last section here to see an example. If you're aiming for a custom TabView-like control, I'd start with PaneSelector. Here's a primitive example (just a start, not ...

5

I think you've got to take over placement manually. First declare the variable setter with no control (None). Next add a SetterBar. Put this inside a Pane so you can control placement. The ImageSize of the Pane needs to be determined by hand. You can use ImageSize -> Full, which makes it fill the width of the notebook window -- perhaps desirable or ...

5

I think HorizontalGauge is just buggy. It shouldn't trigger a dynamic update when you change its state but it does. Simplest case: HorizontalGauge[Dynamic[x]] // Dynamic I would try using this "fixed" version horizontalGauge = Refresh[HorizontalGauge[##], None] & By the way, you could stick this into the built-in symbol's definition, and perhaps if ...

5

Computing Processes are the number of main kernels you can use at the same time. Therefore, you can have on the same computer two Mathematica sessions running and while one computation is running, you can use the other one to do something else. It has nothing to do with your license which is valid for only one computer. The probably easiest method if you ...

4

One can set variables equal to the controller values like below. They can then be used in a computation. Here I just scaled them by a. Manipulate[ {x0, y0, z0} = ControllerState[{"X", "Y", "Z"}, ControllerPath -> {"Sudden Motion Sensor"}]; a {x0, y0, z0}, {a, 1, 100} ] Controlling the view point of 3D graphics could be fun, except that it's ...

4

4

Put your options inside your control (you don't need those cumbersome constructions with patterns and Dynamic@Animate): Animate[Plot[Sin[x + a], {x, 0, 10}, Filling -> 0], {{a, 0, ""}, 0, 5, AppearanceElements -> "PlayPauseButton"}, AnimationRunning -> False]

4

The problem is that Dynamic is preventing ToExpression from evaluating to a symbol. When you drag the slider it's trying to evaluate: ToExpression[ToString[h] <> ToString[1] = 0.1 and you get a message about not being able to set the value of ToExpression. I would use With to create the symbols and insert them into the Dynamic: w = ...

4

This will work. The only change is that I removed the option ControlType and added a "slider function" at the end of the control for v. Note that Pinguin Dirks suggestion in the comments also works, is more convenient and he beat me to it :). Still I guess this code shows how you can have even more control over your slider. Manipulate[ With[{ar = 1/(2*Pi), ...

3

I was just working along the lines of @Rojo's comment: DynamicModule[{i = 0, state = False}, Dynamic[If[ControllerState["Button 1"], If[state, i = i + 1; state = False], If[! state, state = True]]; i] ] Sometimes it appears that the mouse action is intercepted by Mathematica. You may find that unnacceptable.

3

Depending on what you're going to do next, this might be useful: x = {.1, .2, .3, .4, .5}; Outer[Slider[Dynamic[x[[#1]]], {0, 1}] &, Range[Length[x]]] This creates a collection of sliders, one for each element of x. The values of x provide the initialization, and when you move a slider, the corresponding element of x changes. You can see this ...

3

Adding the option TrackedSymbols :> {LowerLimit, UpperLimit} to the Dynamic[..] that holds HorizontalGauge fixes the issue: DynamicModule[{y = 1, LowerLimit = 1, UpperLimit = 10}, Column[{Row[{PopupMenu[Dynamic[LowerLimit], {1, 2, 3, 4}], PopupMenu[Dynamic[UpperLimit], {5, 6, 7, 8, 9, 10}]}], Dynamic[HorizontalGauge[Dynamic[y], {LowerLimit, ...

3

EventHandler DynamicModule[ {u = CharacterRange["a", "e"]}, EventHandler[ Framed[Dynamic@First@u], { {"MouseClicked", 1} :> (u = RotateLeft[u, 1]), {"MouseClicked", 2} :> (u = RotateRight[u, 1]) } ] ] But since second button is showing menu it is not very useful :) It is only a method so You can change event trigger. You can ...

3

Inside a Manipulate it's pretty straightforward: this[x_] := x; that[x_] := x^2; Manipulate[p[3], {p, {this, that}}] Here p takes on value of one of the function names, and then the chosen function is executed when the button is pressed.

3

This is not an answer but an extended comment on andre's answer. I up-voted the answer because it's basically a good one. However, I want to point out two problems with the answer as posted. The following doesn't work because y has a value when mchoice is called. y = 42; Dynamic @ y mchoice["argon", {"solid", "liquid", "gas"}, 3, y] The following ...

3

For #1. The appearance of the controls is set by the code in the file FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "TextResources", "Controls.tr"}] So if you have V7, 8, 9 make copies of that file and then cut and paste the code into a notebook and evaluate and see what the graphics look like. For #2. I think the answer for #1 ... 3 For 1. and 2., all I can say is that I did not notice any change (the generic style is used when exporting to Flash or PDF) and that I don't think you can find out what a control will look like without trying it on a different OS. For 3., you can use ControlsRendering -> Dynamic@If[$OperatingSystem === "Windows", Automatic, "Generic"] The Dynamic ...

3

The 2 CONTROLLING processes effectively means you can run 2 front-ends at the same time. This might be, say, Mathematica 8 and Mathematica 9 on the same machine at the same time, or one copy of Mma 9 on your desktop and another on your laptop (if your License allows same: check with Wolfram). The COMPUTING processes (8) are the number of slaves / cores you ...

3

There is really a general method build into Dynamics in Mathematica meant for these things. It is the second argument of dynamics. One can think of the second argument of Dynamics as an event callback. In GUI, this acts exactly as an event callback in traditional GUI programming, where when one changes state of a UI control, a callback is fired, where one ...

3

Here are a couple variations, including Kuba's ButtonBar, which has yet to be posted as an answer. buttonFunctionBar[lbls_, func_, opts : OptionsPattern[ButtonBar]] := ButtonBar[# :> func[#] & /@ lbls, opts]; actionFunctionMenu[title_, lbls_, func_, opts : OptionsPattern[ActionMenu]] := ActionMenu[title, # :> func[#] & /@ lbls, opts]; ...

2

After reading some of the comments, I thought I'd post this solution I had done some years ago. It does not work through the Bookmarks. As noted, that requires converting things like FEa$$712 to CellContexta$$ -- someone may know how to do that easily. I suspect it could be done. The code below accomplishes the same intention as the OP. It saves the ...

2

Here is a prof of principles that saves the bookmarks (Typeset`bookmarkList) to a string (it could equally well be a file). But it only works if LocalizeVariables -> False is used, which is quite a limitation. Manipulate[ Plot[Fun[2 Pi freq x], {x, 0, 2}, Axes -> showAxes, PlotLabel -> If[showPlotLabel, plotLabel, ""]], {Fun, {Sin, Cos}}, ...

2

Here is another answer using check boxes and button that was asked for. I kept the earlier answer above as is for reference. I used one color. Color difference based on plot can be easily added and left as an exercise Manipulate[ Plot[auf + tuf, {p, 0, 1}, PlotStyle -> {Thickness[0.006]},Frame-> True, FrameLabel -> {{None, None}, {p, ...

2

So you want a SetterBar which provides the argument values to a function Foo? Isn't the most simple way to do this {SetterBar[Dynamic[y], Range[5]], Dynamic[Foo[y]]} Without explicit Dynamic there is maybe really only the solution which was already pointed out by bill s. Manipulate[Foo[v], {v, {1, 2, 3, 4}}] Or if you want it packed into a ...

1

On Mathematica 9 (OSX), Background doesn't colour the default PopupMenu button, it just colours the background around the button. Here's a manual version: act = Rest[ Flatten@Table[{Delimiter, "label " <> ToString[i]}, {i, 1, 3}]]; am = ActionMenu["PopupMenu", act, Appearance -> None, Background -> RGBColor[0.235, 0.486, 0.768], ...

1

I don't really know what you're trying to do here, but here's a simple observation on one of the things you're doing: g = Rasterize[ Style["\[FilledUpTriangle]", Bold, Black, {15, 15}, ShowStringCharacters -> False]] The [15,15} appears to be (mostly) ignored, because the resulting graphic is {9,16}.

1

Manipulate[ choice; Plot[f, {p, 0, 1}, PlotStyle -> {Thickness[0.006], color}, Frame -> True, FrameLabel -> {{f[p], None}, {p, f}},ImagePadding -> 30], Grid[{ {PopupMenu[Dynamic[choice, {choice = #; Which[choice === au1, color = Red; f = au1f, choice === au2, color = Red; f = au2f, choice === tu1, ...

Only top voted, non community-wiki answers of a minimum length are eligible