Skip to main content
13 events
when toggle format what by license comment
Mar 15, 2018 at 17:22 history edited Rolf Mertig CC BY-SA 3.0
edited body
Mar 9, 2018 at 9:42 history edited Kuba CC BY-SA 3.0
added 268 characters in body; edited tags
Feb 23, 2018 at 7:24 vote accept Kuba
Feb 23, 2018 at 11:38
Feb 17, 2018 at 15:37 history tweeted twitter.com/StackMma/status/964886467666464770
Feb 16, 2018 at 20:43 answer added John Fultz timeline score: 10
Feb 16, 2018 at 14:47 comment added Kuba @ArielSepulveda yep, mentioned that difference in a comment above. Already reported, we will see what will happen. I am mostly interested what is the core of the problem so I can get coding habits which will save me from facing it again.
Feb 16, 2018 at 14:43 comment added Ariel Sepulveda If you initialize panel differently you get the behavior you want: panel2[] :=DynamicModule[{x = RandomReal[]}, Framed@Dynamic[x]]. I know that my panel2 function does not behave the same as panel but in many cases it will. In my opinion what you are highlighting is a bug that should be reported.
Feb 16, 2018 at 13:18 comment added Kuba @N.J.Evans ok, yes. Unless I'm mistaken I had a similar idea that if FE thinks the content is the same it will not try to rerender. Notice that panel[] evaluates always to the same thing and Initialization is run later. If you change the definition to panel[] := DynamicModule[{x = RandomReal[]},... it evaluates to something different each time and this time updating works.
Feb 16, 2018 at 13:12 comment added N.J.Evans I understand that, the point was just that it might be a clue as to what is going on since it seems to evaluate Random...[] then compare it to the existing value before deciding whether to update. Which isn't obvious with RandomReal[].
Feb 16, 2018 at 13:08 comment added Kuba @N.J.Evans The last Dynamic is only for comparison and the goal is to have the first panel displayed correctly. Obviously one does not want to put random numbers everywhere just to make stuff work :)
Feb 16, 2018 at 13:05 comment added N.J.Evans Maybe a clue, if you put Dynamic[ trigger; {RandomInteger[], panel[]}, TrackedSymbols :> {trigger} ] panel only updates when RandomInteger[] changes, I assume the same thing happens with your RandomReal[], it's just less likely that RandomReal[] isn't different every time.
Feb 16, 2018 at 12:38 history edited Kuba CC BY-SA 3.0
added 31 characters in body
Feb 16, 2018 at 12:27 history asked Kuba CC BY-SA 3.0