BP
val attach: (Node) -> Unit = if (parent is BorderPane) {
when (this) {
parent.top -> {
{ parent.top = it }
}
parent.right -> {
{ parent.right = it }
}
parent.bottom -> {
{ parent.bottom = it }
}
parent.left -> {
{ parent.left = it }
}
parent.center -> {
{ parent.center = it }
}
else -> {
{ throw IllegalStateException("Child of BorderPane not found in BorderPane") }
}
}
} else {
val children = parent.children
val index = children.indexOf(this);
{ children.add(index, it) }
}
it: Node ->
и заработало, хотя идяе мне говорит что нужно удалить 😂