Thanks Wolfgang.
It appears my memory did some "wishful thinking" in wanting \startuseMPgraphic{name}{key=value}. Although that would have been nice.
Hans van der Meer
On 11 Apr 2016, at 14:42, Wolfgang Schuster mailto:schuster.wolfgang@gmail.com> wrote:
Meer, Hans van dermailto:H.vanderMeer@uva.nl
11. April 2016 um 10:35
I seem to remember the following variations in \startuseMPgraphic.
(1) \startuseMPgraphic{name}{comma separated list of variables}
(2) \startuseMPgraphic{name}{comma separated list of key=value pairs}
In the second case one is able to set a default value to that variable, possibly to be overridden with \useMPgraphic{name}{key=value}.
I very much would like to specify default values on the \startuseMPgraphic definition of the graphic.
However, I cannot get option (2) working. Do I have a bad memory (possible of course ;-), Has it to be done otherwise?
\startuseMPgraphic{hans}{color}
pickup pencircle scaled 1mm;
draw unitsquare scaled 1cm withcolor \MPvar{color};
\stopuseMPgraphic
\setupMPvariables[hans][color=red]
\starttext
\useMPgraphic{hans}
\useMPgraphic{hans}{color=blue}
\stoptext
Wolfgang