Is there a way to construct an interface so that the Code and the Graphics remain in sync? For example I would like to be able to drag/drop and move around different shapes in Graphic while seeing the code change. Then I would like to edit the code so the graphic changes.
Updated image to clarify interface
I'm aware that you can see the graphics source by hitting Ctrl
+Shift
+E
, but this isn't ideal because the graphics source code is often in the displayform and much more verbose. Additionally it doesn't allow me to see how the code changes while I am editing the code. I'm working on some code that uses dynamic currently, but I'm not sure of the right technique just yet.
EDIT: Both the InputField
and the Graphics
should be live and editable. The problem currently is that the the Graphics
elements can't seem to be Dynamic. If you set it as Dynamic it is impossible to re size and move the elements around.
Manipulate[]
? $\endgroup$Manipulate
. I have updated the question to try and make it more clear. Thanks $\endgroup$pt={0,0};Graphics@Circle@Dynamic@pt
will updatept
as you move the circle. If all you want are edits, it could be handled this way. But it won't work if you plan to add new shapes with the drawing tools. It would require more work $\endgroup$