Created
August 10, 2022 01:49
-
-
Save GeePawHill/9d4bb8a21531f369e90be5e86207a2bb to your computer and use it in GitHub Desktop.
A Real World Kotlin Builder
This file contains hidden or 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
| // Snippet one: This code creates an ImageView control inside of a Pane. | |
| val root = pane { | |
| imageview { | |
| image = Image("/bucket.png") | |
| isPreserveRatio = true | |
| } | |
| } | |
| // Snippet two: This is the signature of the function imageview that's being called in the above snippet | |
| fun EventTarget.imageview(url: String? = null, lazyload: Boolean = true, op: ImageView.() -> Unit = {}) { | |
| // ... | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment