[Nitro] Elements and element children

arne at arnebrasseur.net arne at arnebrasseur.net
Thu May 31 10:04:44 EDT 2007


Hi,

I've been playing a bit with elements, but the results aren't really as
what I would have expected, especially regarding child elements.

It occurred to me that in theory elements could be used a bit like layout
managers in AWT/Swing, for instance you could create a Grid element that
would wrap it's children in div's with some style info so they are aligned
in a grid

<Grid cols="3">
   <One />
   <Two with="an option" />
   <One id="other One" />
   ...
</Grid>

And it would render (excuse the ascii art)

+-------+-------+-------+
|       |       |       |
| One   |  Two  | other |
|       |       |  One  |
+-------+-------+-------+
|       |       |       |
|  ...  |       |       |
|       |       |       |
+-------+-------+-------+

Maybe it's a crazy idea, but nevertheless... The biggest obstacle I'm
finding is that @_children is a hash, so you don't have the order of the
children. I would've expected it to be an array.

Am I mising something? Is this simply not what they're intended for?

thx,

(ab)



More information about the Nitro-general mailing list