# Tag Info

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] ...

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

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, ...

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.

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 ...

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