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 {
|
fun <T: Window> addWindow(window: T, index: Int = _windows.size): T {
|
||||||
_windows.add(index, window)
|
_windows.add(index, window)
|
||||||
|
|
||||||
window.screen = this
|
window.screen = this
|
||||||
|
window.wasAdded()
|
||||||
window.resize(width, height)
|
window.resize(width, height)
|
||||||
|
|
||||||
return window
|
return window
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,9 @@ class Window(
|
||||||
|
|
||||||
init {
|
init {
|
||||||
createInternalConstraints()
|
createInternalConstraints()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun wasAdded() {
|
||||||
viewController.window = this
|
viewController.window = this
|
||||||
viewController.loadView()
|
viewController.loadView()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue