Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


  • Prev by Date: RE: NDolve + ParametricPlot
  • Next by Date: RE: Packages--Problem in evaluating functions from my own package!!!
  • Previous by thread: Forcing a parameter to be integer when using 'Integrate'
  • Next by thread: Options to FunctionInterpolation