________________________________________
From: Greg Brown [[email protected]]
Sent: Monday, December 20, 2010 8:54 PM
To: calathus
Cc: [email protected]
Subject: Re: [pivot] are there any tools to convert bxml to Java?
> Also if we may really have declarative GUI design, using Scala may be more
> attractive way. Scala would allow declaring GUI in equivalent code side as
> BXML.
I'm not sure how this would work. Scala is conceptually more akin to Java than
markup. Could you elaborate?
I've been moving a Pivot project of mine bit-by-bit from Java to Scala, so I
think I know what he's getting at here. Scala makes nice-looking, declarative
DSLs possible. I'm not familiar with BXML, but I'm guessing you can declare
things like: "here's a window and here's what it contains". A Scala DSL for
this might look like
val window = Window {
BoxPane {
new Label("here's a Label inside a BoxPane inside a Window")
}
}
I have a very small Scala lib to allow syntax like:
val component = new Button("Hello")
button onClick {
println("You clicked the button!")
}
and
val container = new BoxPane
container += new Label("A label")
and
val label = new Label("A label")
val widget = new SomeWidget
container ++ (label, widget)
etc.
It's extremely rudimentary, but if anyone's interested I can share it with the
list.