I have been playing with the Ruby library \"shoes\". Basically you can write a GUI application in the following way:
Shoes.app do
t = para \"Not clicked!\"
b
You could actually pull this off, but it would require using metaclasses, which are deep magic (there be dragons). If you want an intro to metaclasses, there's a series of articles from IBM which manage to introduce the ideas without melting your brain.
The source code from an ORM like SQLObject might help, too, since it uses this same kind of declarative syntax.