Last active
November 15, 2017 16:25
-
-
Save jschneider/07491cad70da117accbdbb8088ac32d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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