On 11-1-2010 3:07, Aditya Mahajan wrote:
\startmode[error]
\defineoverlay[MP:background]
[\useMPgraphic{MP:backgound}]
\startuseMPgraphic{MP:backgound}
draw OverlayBox randomized 9pt withcolor blue;
\stopuseMPgraphic
\stopmode
\defineframed[boxframed][frame=on,background=MP:background]
% A frame defined with \defineframe does not work
% inside Metapost, so I prevent expansion.
\unexpanded\def\boxed#1{\boxframed{#1}}
ok, i'll make 'm unexpandable in the core
\starttext
\boxed{Boxed in text}
\startMPcode
draw textext("\boxed{boxed in metapost}") ;
%draw textext("\boxframed{boxed in metapost}") ;
\stopMPcode
\stoptext
\starttext
\startMPcode
picture p ; p := textext("boxed in metapost") ;
draw p ;
draw (boundingbox p) randomized 9pt withcolor blue;
\stopMPcode
\stoptext
for more complex cases use image as in
picture p ; p := image (
draw this;
drae that;
) ;
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / 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
___________________________________________________________________________________