Skip to main content
added 180 characters in body
Source Link

This solution may generate a storm of criticisms but may also give you an idea of a path to follow to get where you want. Note that this solution works perfectly in Mathematica 9 but in Mathematica 10 there is a problem that is preventing the last Graphics object added to copy to the right side with the right colors.

    g = Graphics[{Yellow, Disk[]}, ImageSize -> 200];
rightSide = Style["Left side will be copied here.", Gray, Italic];
Deploy@Panel@
  Grid[{{
     Labeled[Button["Copy to Right Side",
       Block[{cellContents = NotebookRead[EvaluationCell[]], rs},
      rightSide  rs = 
         cellContents[[Sequence @@ 
             Position[cellContents, GridBox[{{_, _}}, ___]][[2]]]][[1, 
            1, 1, 1, 2]];
        rightSide = 
       ReplaceAll[DisplayForm@rightSide  ReplaceAll[DisplayForm@rs, GraphicsBox -> Graphics];
        ]
       , ImageSize -> Automatic
       ], Style[g, Deployed -> False]]
     ,
     Labeled[
      "Copy of Left Side"
      , Dynamic@rightSide
      ]
     }}
   , Alignment -> Left
   ]

This is how it looks after the first evaluation:

enter image description here

And this is how it looks after adding two Graphics elements and pressing the "Copy to Right Side" button.

enter image description here

This solution may generate a storm of criticisms but may also give you an idea of a path to follow to get where you want. Note that this solution works perfectly in Mathematica 9 but in Mathematica 10 there is a problem that is preventing the last Graphics object added to copy to the right side with the right colors.

Grid[{{
   Labeled[Button["Copy to Right Side",
     Block[{cellContents = NotebookRead[EvaluationCell[]]},
      rightSide = 
       cellContents[[Sequence @@ 
           Position[cellContents, GridBox[{{_, _}}, ___]][[2]]]][[1, 
         1, 1, 1, 2]];
      rightSide = 
       ReplaceAll[DisplayForm@rightSide, GraphicsBox -> Graphics];
      ]
     , ImageSize -> Automatic
     ], Style[g, Deployed -> False]]
   ,
   Labeled[
    "Copy of Left Side"
    , Dynamic@rightSide
    ]
   }}
 , Alignment -> Left
 ]

This is how it looks after the first evaluation:

enter image description here

And this is how it looks after adding two Graphics elements and pressing the "Copy to Right Side" button.

enter image description here

This solution may generate a storm of criticisms but may also give you an idea of a path to follow to get where you want. Note that this solution works perfectly in Mathematica 9 but in Mathematica 10 there is a problem that is preventing the last Graphics object added to copy to the right side with the right colors.

    g = Graphics[{Yellow, Disk[]}, ImageSize -> 200];
rightSide = Style["Left side will be copied here.", Gray, Italic];
Deploy@Panel@
  Grid[{{
     Labeled[Button["Copy to Right Side",
       Block[{cellContents = NotebookRead[EvaluationCell[]], rs},
        rs = 
         cellContents[[Sequence @@ 
             Position[cellContents, GridBox[{{_, _}}, ___]][[2]]]][[1,
            1, 1, 1, 2]];
        rightSide = 
         ReplaceAll[DisplayForm@rs, GraphicsBox -> Graphics];
        ]
       , ImageSize -> Automatic
       ], Style[g, Deployed -> False]]
     ,
     Labeled[
      "Copy of Left Side"
      , Dynamic@rightSide
      ]
     }}
   , Alignment -> Left
   ]

This is how it looks after the first evaluation:

enter image description here

And this is how it looks after adding two Graphics elements and pressing the "Copy to Right Side" button.

enter image description here

Source Link

This solution may generate a storm of criticisms but may also give you an idea of a path to follow to get where you want. Note that this solution works perfectly in Mathematica 9 but in Mathematica 10 there is a problem that is preventing the last Graphics object added to copy to the right side with the right colors.

Grid[{{
   Labeled[Button["Copy to Right Side",
     Block[{cellContents = NotebookRead[EvaluationCell[]]},
      rightSide = 
       cellContents[[Sequence @@ 
           Position[cellContents, GridBox[{{_, _}}, ___]][[2]]]][[1, 
         1, 1, 1, 2]];
      rightSide = 
       ReplaceAll[DisplayForm@rightSide, GraphicsBox -> Graphics];
      ]
     , ImageSize -> Automatic
     ], Style[g, Deployed -> False]]
   ,
   Labeled[
    "Copy of Left Side"
    , Dynamic@rightSide
    ]
   }}
 , Alignment -> Left
 ]

This is how it looks after the first evaluation:

enter image description here

And this is how it looks after adding two Graphics elements and pressing the "Copy to Right Side" button.

enter image description here