aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/Root.kt4
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/Widget.kt4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Root.kt b/src/main/kotlin/pl/treksoft/kvision/core/Root.kt
index c5f4a2d6..ef2e7616 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/Root.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/Root.kt
@@ -24,4 +24,8 @@ class Root(id: String, private val fluid: Boolean = false) : Container() {
rootVnode = KVManager.patch(rootVnode, render())
}
+ override fun getRoot(): Root? {
+ return this
+ }
+
}
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
index aaddbe39..438370cf 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
@@ -182,4 +182,8 @@ open class Widget(classes: Set<String> = setOf()) : KVObject {
protected open fun afterDestroy() {
}
+
+ internal open fun getRoot(): Root? {
+ return this.parent?.getRoot()
+ }
}