After running below code
DynamicModule[{temp},
data = Range[10];
temp = {};
Column[{
Button["reset", temp = {}],
TogglerBar[Dynamic[temp], data, Appearance -> "Horizontal" -> {Automatic, 5}],
Dynamic[temp]
}]
]
I got
Now I want to copy the dynamically generated list and paste it elsewhere. But I found sometimes it works, sometimes it is not. You can see below gif
What is wrong with my code? Why sometimes it gives temp$$
, sometimes not? How to make dynamic results easy to copy?
Update
With Kuba's method to view "SelectionData", it is clear what is going on, see below gif. So proper selection will give expected result instead of temp$$
DynamicBox
or not. To achieve a stable behavior you can useInputField@Dynamic[temp]
for example. $\endgroup$DynamicBox
or its contents. -- The menu command Cell > Show Expression will reveal what you actually pasted. $\endgroup$DynamicBox
is there but FE keeps track what it really represents. In this case a box representation oftemp
. More or less ;) $\endgroup$}
, then{ }
will be highlighted and you'll be selecting the right thing. If the cursor is placed too far after}
, then there is no syntax highlighting and you'll be selecting theDynamicBox
. One can use the arrow key to move to the correct position. Double-clicking on{
or}
also results in a correct selection. $\endgroup$