[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: I like this navbar

On 9 Apr 1999, Florian Hars wrote:

> The definition of the apperance of the button can be viewed as part of
> its definition (we are talking about someting derived from a wml::des
> package, so html purism is not really adequate here), and if you do,
> it appears unnatural to separate the two. The actual image generation
> is done during rendering, not during the definition.

The <navbar:define> tag defines the grammar, it has nothing to do
with rendering or appearance. It's why i think you should remove the
``nohints'' attribute from this tag too. You may object that the
``txtcol_normal'' and ``txtcol_select'' attributes are also about
rendering. I agree and think they should go to <navbar:render> (looks
like we think too muck ;-))

> And I think it is easier to debug and maintain this way. There are
> exactly 6 (in words: six) statements in navbar-FH.wml related to image
> genaration (a protect/restore pair, one each to put the information
> into the $CFG hash and read it out again, and two conditional calls of
> the appropriate function).

Without these 6 statements, the code is easier to debug and maintain ;-)

I have slightly modified wml::std::lang to help customization. The
wildcard used in the <lang:star:> tags can be redefined, e.g.
  <lang:set-wildcard %>

Lazy people who want to save keystrokes may read this example
(with wml-SNAP > 07-Apr-1999)

###   Begin example
<lang:set-wildcard %>
<define-tag navbar:lazy>
    <subst-in-string "<XNAVBAR:button %body>"
        "%" "<lang:star: %>">
  XNAVBAR navbar>

<navbar:define name=test>
  <navbar:button img="<lang:star: foo-%>-*.gif"
                 url="<lang:star: foo.%.html>"
                 txt="<de: Hallo><en: Hello>">
#    Does the same job
  <navbar:lazy img="foo-%-*.gif"
               txt="<de: Hallo><en: Hello>">
#    Restore default value
###   End example

> But I am not dogmatic about this, in fact I do not even use images for
> my buttons right now :-).

I'm afraid i am :-(. But it's your code, so _you_ decide. Tell me when
you want to upgrade wml_contrib/navbar-FH.wml, i will.


Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com