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
|
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 kotlinx.html.p
|
||||||
import space.kscience.visionforge.VisionControlEvent
|
import space.kscience.visionforge.VisionControlEvent
|
||||||
import space.kscience.visionforge.html.*
|
import space.kscience.visionforge.html.*
|
||||||
import space.kscience.visionforge.onClick
|
import space.kscience.visionforge.onClick
|
||||||
|
import kotlin.time.Duration.Companion.seconds
|
||||||
|
|
||||||
|
|
||||||
fun main() = serve {
|
fun main() = serve {
|
||||||
@ -25,6 +30,7 @@ fun main() = serve {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
h2 { +"Control elements" }
|
||||||
|
|
||||||
vision {
|
vision {
|
||||||
htmlCheckBox {
|
htmlCheckBox {
|
||||||
@ -41,13 +47,19 @@ fun main() = serve {
|
|||||||
onValueChange(context) {
|
onValueChange(context) {
|
||||||
pushEvent(this)
|
pushEvent(this)
|
||||||
}
|
}
|
||||||
|
context.launch {
|
||||||
|
while (isActive) {
|
||||||
|
delay(1.seconds)
|
||||||
|
numberValue = ((numberValue?.toInt() ?: 0) + 1) % 10
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vision {
|
vision {
|
||||||
button("Click me"){
|
button("Click me") {
|
||||||
onClick(context){
|
onClick(context) {
|
||||||
pushEvent(this)
|
pushEvent(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ import space.kscience.visionforge.*
|
|||||||
@Serializable
|
@Serializable
|
||||||
public abstract class VisionOfHtml : AbstractVision() {
|
public abstract class VisionOfHtml : AbstractVision() {
|
||||||
public var classes: Set<String>
|
public var classes: Set<String>
|
||||||
get() = properties.get(::classes.name,false).stringList?.toSet() ?: emptySet()
|
get() = properties[::classes.name, false].stringList?.toSet() ?: emptySet()
|
||||||
set(value) {
|
set(value) {
|
||||||
properties[::classes.name] = value.map { it.asValue() }
|
properties[::classes.name] = value.map { it.asValue() }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user