diff options
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt index da41db9f..3b045fa6 100644 --- a/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt +++ b/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt @@ -46,6 +46,15 @@ open class StackPanel( */ var activeIndex by refreshOnUpdate(-1) + /** + * The active (visible) child. + */ + var activeChild + get() = children[activeIndex] + set(value) { + activeIndex = children.indexOf(value) + } + init { @Suppress("LeakingThis") init?.invoke(this) |