Please, consider the following code:
ColorSlider[
Dynamic[x], ImageSize -> {800, 100}, AppearanceElements -> "Spectrum"
]
Button["get color",
MessageDialog @ Dynamic[x];
CopyToClipboard @ funct @ Dynamic[x];
]
Graphics[{Dynamic[x], Disk[]}, Frame -> True, FrameLabel -> Dynamic[x]]
To get the value of RGBColor
in a string form, I have changed, in turn, the above funct
with OutputForm
, StringForm
etc. obtaining always one of two results:
Dynamic[x] (* or *) StandardForm \!\(\*DynamicBox[ToBoxes[Global`x, StandardForm], ImageSizeCache->{380., {2., 8.}}]\)
To track the issue I tried
Slider[Dynamic[z]]
Print @ Dynamic[z];
Button["copy",
MessageDialog @ Dynamic[z];
CopyToClipboard @ Dynamic[z];
]
Button["paste",
Paste @ Dynamic @ z;
]
and understood that CopyToClipboard
get the whole DynamicBox
, not its 'current content'. How can I get rid of the "wrapper" ?
Addendum
I just have realized taht the color value can be read by means of
InputField[Dynamic[x]]
but it's evidently an expedient and doesn' enlighten the broader subject.
Dynamic
from the button.Dynamic
isHoldAll
so it stays this way untill it's displayed.Button
isHoldRest
so you will get the current value ofx
anyway. p.s. you can useSetting
too. $\endgroup$ – Kuba♦ Feb 24 '16 at 21:59Setting
does perfectly the job. I'm going to study the other topics you mentioned. $\endgroup$ – mitochondrial Feb 24 '16 at 22:09