Boost logo

Boost :

From: Brock Peabody (brock.peabody_at_[hidden])
Date: 2004-03-05 10:50:15


> -----Original Message-----
> On Behalf Of David Abrahams

> Sure, though I would never call the function "add". I'd be looking
> for declarative DSELs like:
>
>
> window("Warning: now entering twilight zone")
> [
> text_field("my favorite color is:"),
> button("OK") | button("cancel")
> ]

I've got a library that works a lot like this. The code might not be much
use to boost since it is all win32, but my experiences with the syntax
might. My version of the above would look something like:

   +(
      "my favorite color is:"
      |
      push_button(on_ok)*"OK" & push_button(on_cancel)*"Cancel
   )*"Warning: now entering twighlight zone"

This would create a window that looked something like:

   -----Warning: now entering twighlight zone-----
   | |
   | my favorite color is: |
   | |
   | ----- ---------- |
   | | OK | | Cancel | |
   | ------ ---------- |
   -----------------------------------------------

The unary '+' operator creates a "group" box from an expression.

'|' puts the first operator on top of the second

'&' puts the first operator in front (horizontally) of the second

push_button is a widget that must have a function object in its constructor

'*' sets the text of a window


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk