# Tag Info

0

There is a great option at the end of Manipulate called Bookmarks. I was unaware of this until today. What you might do in order to see the syntax of how to use it is to set the parameters to a desired value and then click the little + icon on the upper right and invoke the "Add to Bookmarks" option. Say you give it a name (e.g., MyBookmark). To see what ...

4

The problem seems to be that a TagBox that is generated is handled incorrectly by the front end. The TagBox has the form TagBox[bigExpr, Deploy, DefaultBaseStyle -> "Deploy"]. In this expression the second argument Deploy is quite meaningless. I couldn't trace any further than this TagBox as I cannot see how the front end handles it. How the kernel ...

3

Quick fix is to add ContentSelectable -> False, ImageSize -> Dynamic[Automatic, None] to Graphics options. Now the it is behaving well with exeption of orange frame that appears to allow you to change ImageSize, which is supressed by Dynamic[#, None]. More generic approach Something strange is happening. When we set Deployed -> True and ...

1

Unfortunately FullGraphics is extremely out-of-date: it seems that it has not changed much since version 5. Currently correct solution may be only FrontEnd-based. FrontEnd has a command Convert Dynamic to Literal under Evaluation menu which helps with Dynamic but not with Ticks. A workaround for Ticks is Exporting the complete Graphics[...] as a Notebook, ...

0

Thanks again for the help. Here's the whole commented code I wrote to produce my desired output in a nice form, after updating the parameters. It also simulates random demand und uses another recursion to calculate the inventory level and the optimal prices for the given inventory level: (*Recursive Formulation of Joint Inventory/ Dynamic-Pricing Problem \ ...

3

(This is more of an extended comment until a better understanding evolves.) Finally I've found the relevant MathGroup thread from old - apparently the behaviour is as old as the dynamic interactivity in Mathematica. At that time, Norbert Pozar introduced a really simple example to demonstrate the strange internals of DynamicModule when a symbol in an ...

1

I modified your code to eliminate some numerically induced imaginary fuzz. ClearAll[y, k]; m = 0.5; λ = 1/187.; k[0] = 0; y[0] = 0; r[t_Integer, z_] := Chop @ N[1/z^m (-(1/λ)*E^(-λ*z) + 1/λ + k[t - 1]*λ* Integrate[(z - w)^m*E^(-λ*w), {w, 0, z}])]; y[t_Integer] := y[t] = Chop @ N @ ArgMax[{Re@r[t, j], j > y[t - 1]}, j]; k[t_Integer] := k[t] = Chop ...

1

Maybe this does what you want? DynamicModule[ {enabled = True, pos}, Column[ { Dynamic[ Print[DateString[] <> " updating"]; EventHandler[ Graphics@Disk[], {"MouseClicked" :> Print["Click"]} ] ] , Dynamic[pos[]] } ] , Initialization :> (pos[] := MousePosition["Graphics"]) ] Really... trial and error.

4

How about this: ClearAll[framed, button, $opts];$opts = {}; Options[framed] = {a -> 1}; button[x_] := With[{opts = $opts}, Button[x, Print@framed[x, opts]]]; framed[x_, opts : OptionsPattern[]] := Block[{$opts = Flatten[{opts}]}, Framed[{button[x], OptionValue@a}] ]; and you use this as before: Print@framed["Push", a -> 1111] ...

1

Problem 1 Your first problem seems to be related to a subtle bug (?) which results in a Dynamic[t] to be treated slightly different than a Dynamic[something[t]]. You can get the first button to work with either double negating the boolean as you did or by using TrueQ[t] (which might be a good idea in the sense of of defensive programming anyway). So this ...

3

Well, that's not a full answer but a walkaround. I've noticed that even when only moving cursor in front of image2 (without LocatorPane) CPU usage is raising to 50% and supressing Tooltips does not change much. So since you want them, leave them, and Rasterize the rest: point = {0.4, 0}; Row[{ Overlay[{ Rasterize@image2, ...

1

The following code works. But, I am not sure if it was you are trying to achieve: Version 1 creating a dialog as seems to be your intent (your code but with an additional image: imageIUsed = ExampleData[{"TestImage", "Clock"}] anotherImage = ExampleData[{"TestImage", "Airplane"}] maniTransform[image_] := Manipulate[ Row[{Show[{Image[image], ...

0

Some remarks: Do not use %-operators successively, as they only work as expected if input/output are in separate cells. You don't have to define A with SetDelayed, as it is constant. Use options for the Plot to set size and padding. Take the first solution (there is only one, but is wrapped in list), and do a multiple replacement for the $c_i$. Easiest is ...

3

Use Dynamic inside Mouseover Graphics[{ Mouseover[{Black, Disk[{-10, 0}]}, Dynamic[{m = "D"; Red, Disk[{-10, 0}]}]], Mouseover[{Black, Rectangle[{10, 0}]}, Dynamic[{m = "R"; Red, Rectangle[{10, 0}]}]], Dynamic@Text[m, {0, 0}] }, ImageSize -> 400]

2

This uses the second argument of dynamics, which acts like an event call back. In there, you do the specific action needed when that dynamic changes. This localizes the logic with its own control variable. Makes it easier to manage. If you like more information about this method, see this question But you really need to fix/improve the way the function ...

0

The kind of Manipulate you want to build can be made by taking a state-machine approach and using Refresh with the option TrackedSymbols Here is a relatively brief working example: SeedRandom[42]; Manipulate[ Row[{ Dynamic@Refresh[ If[event != "idle", update[]]; Column[{plot, mean}], TrackedSymbols -> {event}], ...

3

To mimic Manipulate, wrap the body in Dynamic: DynamicModule[{x, y}, Dynamic[ y = f[x]; {Slider[Dynamic[x]], Dynamic[x], Dynamic[g[y]]}] ] (It's what Manipulate does.) But putting the y code inside its own Dynamic is a little cleaner: DynamicModule[{x, y}, {Slider[Dynamic[x]], Dynamic[x], Dynamic[y = f[x]; Dynamic[g[y]]]} ]

3

You should do something like: DynamicModule[{x, y}, {Slider[Dynamic[x]], Dynamic[x], Dynamic[g[y]]} , Initialization :> (y = f[x];)] for full control I would avoid using Manipulate. When you don't know what's going on, use Print for example. Let's focus on your Manipulate code: Manipulate[Module[{y}, Print[1]; y = f[x]; {x, g[y]}], {x, 0, 1}] ...

1

I think you may have too many Dynamic calls. This seems to start at the desired state 1 after each re-evaluation. Manipulate[tick; Dynamic@Switch[tabNumber, tab1, Plot[x^2, {x, 0, 1}], tab2, Plot[1 - x^2, {x, 0, 1}], _, Plot[Sin[x] E^(-x), {x, 0, 1}]], TabView[{"1" -> Column[tabNumber = tab1; {Row[{"1 selected"}]}], "2" -> Column[tabNumber ...

3

Here is one way to rewrite your minimal example. The main thing I have changed (apart from removing surplus Dynamics) is to use downvalues of a single symbol to store the state of each sector. That is, instead of creating symbols sector1, sector2 etc by string manipulation, use sector[1], sector[2] and so on. The definitions of ring, cir, points1 and ...

Top 50 recent answers are included