commonMain.ru.casperix.demo_platform.application.DemoApplicationView.kt Maven / Gradle / Ivy
package ru.casperix.demo_platform.application
import ru.casperix.light_ui.component.panel.Panel
import ru.casperix.light_ui.element.Container
import ru.casperix.light_ui.element.Element
import ru.casperix.light_ui.layout.Layout
class DemoApplicationView {
val controlPanel = Panel(Layout.VERTICAL)
val demoContainer = Container(Layout.VERTICAL)
val uiRoot = Container(Layout.VERTICAL, controlPanel, demoContainer)
fun setRoot(root: Element) {
demoContainer.children.toList().forEach { demoContainer.remove(it.element) }
demoContainer.add(root)
}
}