Am 25.09.2011 um 02:43 schrieb Aditya Mahajan:

> I am writing a module which uses metapost in the background for drawing. I 
> wanted to create an interface for setting the style and color of metapost 
> labels but using \doset...attributes is not working.
> 
> Here is an example:
> 
> \definenamespace
>  [test]
>  [style=yes,
>   name=test,
>   command=yes,
>   setup=yes]
> 
> \definetest
>  [blue]
>  [color=blue, text=Blue]
> 
> \definetest
>  [two]
>  [blue]
>  [style=\bold, text=Two]
> 
> \starttext
> \edef\currenttest{two}
> \startMPdrawing
>  label.lft(\sometxt{\dosettestattributes{style}{color}
>  \testparameter{text}}, (0,0)) ;

You can use the old \doattributes command which is expandable.

label.lft(\sometxt{\doattributes{\currenttesthash}{style}{color}{\testparameter{text}}},(0,0))
 ;

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to