commonMain.com.soywiz.korui.UiLabel.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of korgw Show documentation
Show all versions of korgw Show documentation
Portable UI with accelerated graphics support for Kotlin
package com.soywiz.korui
import com.soywiz.korio.util.*
import com.soywiz.korui.native.*
open class UiLabel(app: UiApplication, val label: NativeUiFactory.NativeLabel = app.factory.createLabel()) : UiComponent(app, label) {
var text by RedirectMutableField(label::text)
var icon by RedirectMutableField(label::icon)
override fun copyFrom(that: UiComponent) {
super.copyFrom(that)
that as UiLabel
this.text = that.text
}
}
inline fun UiContainer.label(text: String = "Button", block: UiLabel.() -> Unit = {}): UiLabel {
return UiLabel(app).also { it.text = text }.also { it.parent = this }.also(block)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy