Tweak window setup order so viewsd have access to screen in View.wasAdded
This commit is contained in:
parent
da8c5f73cf
commit
8a3be763f1
|
@ -37,8 +37,11 @@ open class CacaoScreen: Screen(LiteralText("CacaoScreen")) {
|
|||
*/
|
||||
fun <T: Window> addWindow(window: T, index: Int = _windows.size): T {
|
||||
_windows.add(index, window)
|
||||
|
||||
window.screen = this
|
||||
window.wasAdded()
|
||||
window.resize(width, height)
|
||||
|
||||
return window
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,9 @@ class Window(
|
|||
|
||||
init {
|
||||
createInternalConstraints()
|
||||
}
|
||||
|
||||
fun wasAdded() {
|
||||
viewController.window = this
|
||||
viewController.loadView()
|
||||
|
||||
|
|
Loading…
Reference in New Issue