ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm <hraban@fiee.net>
Subject: postponed processing
Date: Sun, 15 Jan 2006 14:18:19 +0100	[thread overview]
Message-ID: <028CC4DB-33C2-41B8-9982-9DC04BC8CCCC@fiee.net> (raw)

Me again...
I'd like to define an address layer in my environment:

--- start env --

\definelayer[senderlayer]
	[x=0mm, y=0mm, width=\paperwidth, height=\paperheight]

\def\Sender#1#2#3{\setvalue{SenderKey#1}{#2}\setvalue{SenderVal#1}{#3}}
\def\GetSenderLine#1{\bTR\bTD\doiftextelse{\getvalue{SenderKey#1}}%
	{\getvalue{SenderKey#1}:}{}\eTD\bTD\getvalue{SenderVal#1}\eTD\eTR}

\setlayerframed[senderlayer]
	[%corner={right}, location={left,bottom},
	x=\dimexpr(\getvalue{LogoHOffset}-\bleed), %\getvalue{LogoHOffset},
	y=\getvalue{LogoHeight}] % \dimexpr(\getvalue{LogoHeight}+\topspace)
	[height=46mm, width=\dimexpr(\getvalue{SenderKeyWidth}+\getvalue 
{SenderValueWidth}),
	frame=off, offset=none, align={left,top}]{%
	\setupTABLE[frame=off]
	\setupTABLE[x][1][width=\getvalue{SenderKeyWidth}, align=left, style= 
{\keystyle\strut}]
	\setupTABLE[x][2][width=\getvalue{SenderValueWidth}, align=right,  
style={\valstyle\strut}]
	\bTABLE
	\dostepwiserecurse{1}{9}{1}{% count from 1 to 9, step 1
		\expanded{\GetSenderLine{\recurselevel}}
	}
	\eTABLE
}

\def\EnableSender{\setupbackgrounds[rightpage][page]
	[background={\currentvalue, senderlayer}]}

--- stop env ---

and use that later in a product/component:

--- start text ---

\Sender{1}{Name}{Hraban}
\Sender{2}{Web}{www.fiee.net}

\EnableSender

--- stop text ---

Of course it doesn't work, because the Sender values aren't set via  
typesetting the address in the environment, and \x1c\currentvalue in  
\EnableSender hasn't the right value either.

Holger solves this in his letter style (wiki) via setups.
Is that the best approach?
How else could I postpone the senderlayer processing?
(I guess it would work with some expansion magic, but I'd like to  
stay at ConTeXt's surface as much as possible.)


Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/
http://contextgarden.net
http://www.cacert.org (I'm an assurer)

             reply	other threads:[~2006-01-15 13:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-15 13:18 Henning Hraban Ramm [this message]
2006-01-15 18:06 ` Hans Hagen
2006-01-15 19:19   ` Henning Hraban Ramm
2006-01-15 21:29     ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=028CC4DB-33C2-41B8-9982-9DC04BC8CCCC@fiee.net \
    --to=hraban@fiee.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).