Skip to content

Instantly share code, notes, and snippets.

@jschneider
Last active November 15, 2017 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jschneider/07491cad70da117accbdbb8088ac32d9 to your computer and use it in GitHub Desktop.
Save jschneider/07491cad70da117accbdbb8088ac32d9 to your computer and use it in GitHub Desktop.
package com.cedarsoft.autoresultat.ng.agents
import javafx.scene.paint.Color
import tornadofx.*
/**
* @author Johannes Schneider ([js@cedarsoft.com](mailto:js@cedarsoft.com))
*/
fun main(args: Array<String>) {
launch<StyleDemo>()
}
class StyleDemo : App(MyView::class, MyStyles::class) {
}
class MyView : View() {
override val root = borderpane {
center {
button("Click me") {
action {
find<MyFragment>().openModal()
}
}
}
bottom {
label("Hello in MyView") {
addClass(MyStyles.daStyle)
}
}
}
}
class MyFragment : Fragment() {
override val root = hbox {
label("Hello World") {
addClass(MyStyles.daStyle)
}
}
}
class MyStyles : Stylesheet() {
companion object {
val daStyle by cssclass()
}
init {
daStyle {
backgroundColor = multi(Color.RED, Color.BLUE, Color.YELLOW)
textFill = Color.ORANGE
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment