Skip to content

Instantly share code, notes, and snippets.

@GeePawHill
Created December 27, 2020 17:35
Show Gist options
  • Save GeePawHill/062d61f6ac0807145ac07a2678755485 to your computer and use it in GitHub Desktop.
Save GeePawHill/062d61f6ac0807145ac07a2678755485 to your computer and use it in GitHub Desktop.
To TDD or not to TDD?
package org.geepawhill.yz
import tornadofx.*
class YzView : View() {
val model = YzModel(YzGame())
override val root = pane {
hbox {
button("Start") {
action { model.start() }
}
button("Roll") {
enableWhen(model.canRoll)
action { model.roll() }
}
model.dice.forEach {
imageview {
imageProperty().bind(it.imageReadOnly)
}
label(it.pipsReadOnly)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment