ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Cloning versus copying
@ 1999-06-05  6:44 David Arnold
  1999-06-05 12:49 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: David Arnold @ 1999-06-05  6:44 UTC (permalink / raw)


All,

What's the difference between cloning and copying, as in the following file?

%output=pdf

\setupinteraction
  [state=start]

\setupcolors
  [state=start]

\tracefieldstrue

\definesymbol[yes-a][$\times$]
\definesymbol[yes-b][$\star$]
\definesymbol[nop-a][$\bullet$]
\definesymbol[nop-b][$-$]

\definefield[example-1][radio][setup 1][ex-a,ex-b,ex-c][ex-c]
\definesubfield[ex-a,ex-b,ex-c][setup 1][yes-a,nop-a]

\setupfield [setup 1] [width=0.5cm,height=0.5cm,framecolor=red]
\setupfield [setup 2] [width=.75cm,height=.75cm]

 \copyfield[ex-a][ex-x]
 \copyfield[ex-b][ex-y]
 \copyfield[ex-c][ex-z]

 \clonefield[ex-a][ex-p][setup 2][yes-b,nop-b]
 \clonefield[ex-b][ex-q][setup 2][yes-b,nop-b]
 \clonefield[ex-c][ex-r][setup 2][yes-b,nop-b]

\showfields[example-1,ex-a,ex-b,ex-c,ex-x,ex-y,ex-z,ex-p,ex-q,ex-r]

\starttext

Hello, cruel world!

\hbox{\field[ex-a]\field[ex-b]\field[ex-c]}

\hbox{\field[ex-x]\field[ex-y]\field[ex-z]}

Some more text.

\hbox{\field[ex-p]\field[ex-q]\field[ex-r]}

\stoptext

I see no difference, and I can't think of a situation where I would want
either of these behaviors. Why is it that when I click in ex-q, the fields
ex-a,ex-b,ex-c, ex-z, ex-y, and ex-z revert to nop-a?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Cloning versus copying
  1999-06-05  6:44 Cloning versus copying David Arnold
@ 1999-06-05 12:49 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 1999-06-05 12:49 UTC (permalink / raw)
  Cc: ntg-context

David Arnold wrote:

> What's the difference between cloning and copying, as in the following file?

A clone canhave its own settings, and therefore takes more resources in
the pdf file, while a copy is a 1 to one copy. So, a same field can have
a left|center|right aligned alternative as clone, but not as copy (the
same field repeated on different pages butwith the same appearance).   

When using \definemainfield instead of \definefield, fields are copied
automatically when multiple \field[name] calls occur. 

[As soon as I've reasons to use them (some projects needing fields or
so), I will make some more examples in the process.]  

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-06-05 12:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-05  6:44 Cloning versus copying David Arnold
1999-06-05 12:49 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).