merging compose branch
This commit is contained in:
parent
1022b74d23
commit
629923c03a
@ -1,4 +0,0 @@
|
||||
job("Build") {
|
||||
gradlew("openjdk:11", "build")
|
||||
}
|
||||
|
@ -1,9 +1,14 @@
|
||||
package space.kscience.visionforge.examples
|
||||
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.isActive
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.html.h2
|
||||
import kotlinx.html.p
|
||||
import space.kscience.visionforge.VisionControlEvent
|
||||
import space.kscience.visionforge.html.*
|
||||
import space.kscience.visionforge.onClick
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
|
||||
fun main() = serve {
|
||||
@ -25,6 +30,7 @@ fun main() = serve {
|
||||
}
|
||||
}
|
||||
}
|
||||
h2 { +"Control elements" }
|
||||
|
||||
vision {
|
||||
htmlCheckBox {
|
||||
@ -41,6 +47,12 @@ fun main() = serve {
|
||||
onValueChange(context) {
|
||||
pushEvent(this)
|
||||
}
|
||||
context.launch {
|
||||
while (isActive) {
|
||||
delay(1.seconds)
|
||||
numberValue = ((numberValue?.toInt() ?: 0) + 1) % 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ import space.kscience.visionforge.*
|
||||
@Serializable
|
||||
public abstract class VisionOfHtml : AbstractVision() {
|
||||
public var classes: Set<String>
|
||||
get() = properties.get(::classes.name,false).stringList?.toSet() ?: emptySet()
|
||||
get() = properties[::classes.name, false].stringList?.toSet() ?: emptySet()
|
||||
set(value) {
|
||||
properties[::classes.name] = value.map { it.asValue() }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user