Pasting a color from DrawGraphicsPalette
- To: mathgroup at smc.vnet.net
- Subject: [mg67553] Pasting a color from DrawGraphicsPalette
- From: Peter Breitfeld <phbrf at t-online.de>
- Date: Fri, 30 Jun 2006 04:15:13 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Look at this simple example:
In:=Show[Graphics[{Green, Rectangle[{0,0}{1,1}]}]];
If I enter "Green" with the keyboard, I get a green rectangle as
expected. But when I paste "Green" in by klicking on the apropriate
button in the DrawGraphicsPalette (from Package DrawGraphics by David
Park) the following error is reported:
MakeExpression::"boxfmt":"\!\(TextForm\) in \!\(MakeExpression[\(\(\"Green\", \
TextForm\)\)]\) is not a box formatting type. A box formatting type is any \
member of $BoxForms. \!\(\*ButtonBox[\"Mehr\[Ellipsis]\", \
ButtonStyle->\"RefGuideLinkText\", ButtonFrame->None, \
ButtonData:>\"General::boxfmt\"]\)"
So I tried to add "TextForm" to "$BoxForms" using:
AppendTo[$BoxForms, TextForm]
Now I get a green Rectangle but still an error:
ParentForm::"deflt":"The ParentForm of \!\(ParentForm[TextForm]\) is not \
defined on $BoxForms. \!\( \*ButtonBox[\(Mehr\[Ellipsis]\), \
ButtonData:>\"ParentForm::deflt\", ButtonStyle->\"RefGuideLinkText\", \
ButtonFrame->\"None\"]\)
So I tried to define a ParentForm, eg:
ParentForm[TextForm]^=StandardForm
Mathematica doesn't like this, because TextForm is protected.
No I could unprotect TextForm an assign the ParentForm. Now all works
well, but I'm not sure if there are unwanted side-effects coming up.
Does anyone know more about this?
Gruss Peter
--
==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de