Skip to content

Instantly share code, notes, and snippets.

@cioccarellia
Last active July 28, 2020 13:38
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 cioccarellia/fdb006fc155922cdf6431323496a746c to your computer and use it in GitHub Desktop.
Save cioccarellia/fdb006fc155922cdf6431323496a746c to your computer and use it in GitHub Desktop.
val window = ApplicationWindow()
// 'this' is the global scope
window.apply {
// 'this' scopes to 'window'
this.content.loadImage("whatever.png")
// 'this' scopes to 'window'
this.header.buttons.run {
// 'this' scopes to 'window.header.buttons'
add("X")
add("_")
add("□")
}
// 'this' scopes to 'window'
this.onWindowClose = {
println("Bye bye")
}
// 'this' scopes to 'window'
this.show()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment