Scala property bindings
Scala 其他开发相关
共0Star
详细介绍
This library provides property bindings similar to Qt signal slot system,
JavaFx’s properties and other.
示例程序:
private class Model {
val text = new Observable("count: 0")
private var count =
def increment() {
count += 1
text() = "count: " + count
}
}
object Example extends SimpleSwingApplication {
private val model = new Model
def top = new MainFrame {
title = "Example"
contents = new GridPanel(2, 1) {
val button = new Button("Press Me!")
contents += button
val label = new Label {
text = observes(model.text, text_=)
}
contents += label
listenTo(button)
reactions += {
case ButtonClicked(_) => model.increment()
}
}
}
}
-
8 Star
-
0 Star
-
0 Star
-
1074 Star
-
0 Star
-
0 Star
-
0 Star
-
0 Star