![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 12/6/2012 8:10 PM, Marco Patzer wrote:
On 2012–11–25 Marco Patzer wrote:
in one of the last few betas the MetaPost instance mechanism broke.
Did the interface change again? The following does not work on today's beta, only “alpha” and “gamma” are printed.
\defineMPinstance [myinstance] [metafun]
\startuseMPgraphic{alpha} draw textext("alpha") ; \stopuseMPgraphic
\startuseMPgraphic{myinstance::beta} draw textext("beta") ; \stopuseMPgraphic
\starttext \useMPgraphic{alpha} \useMPgraphic{myinstance::beta} \startMPcode{myinstance} draw textext("gamma") ; \stopMPcode \stoptext
sure, we have a different interface on odd days Currently instances are played with a bit (as Alan and I want the chemical module to run in its own but also want it to be public). Anyhow, one complication is in the related variables. I now have a version that supports this: \defineMPinstance [myinstance] [metafun] \startuseMPgraphic{alpha} draw textext("alpha") ; \stopuseMPgraphic \startuseMPgraphic{myinstance::beta} draw textext("beta") ; \stopuseMPgraphic \startuniqueMPgraphic{myinstance::beta}{width} draw textext("beta") xsized \MPvar{width} ; \stopuniqueMPgraphic \startuseMPgraphic{myinstance::epsilon}{width,height} draw textext("epsilon") xysized (\MPvar{width},\MPvar{height}) ; \stopuseMPgraphic \setMPvariables [myinstance::beta] [width=5cm] \setMPvariables [epsilon] [width=5cm, height=5cm] \starttext one : \useMPgraphic{alpha} \blank two : \useMPgraphic{myinstance::beta} \blank three : \startMPcode{myinstance} draw textext("gamma") ; \stopMPcode \blank four : \reuseMPgraphic{myinstance::beta}{width=2cm} \blank five : \startMPcode{myinstance} draw textext("delta") ; \stopMPcode \blank six : \reuseMPgraphic{myinstance::epsilon}{height=2cm} \blank seven : \reuseMPgraphic{myinstance::epsilon} \blank \stoptext Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------