2017-09-15 8 views

答えて

3

何がやりたいことは、ウィンドウの現在の幅/高さを保存し、ビューを再びドッキングされているとき、あなたはそこに両方の​​操作を行うにonDockオーバーライドできることを復元する場合:

override fun onDock() { 
    if (config["w"] != null && config["h"] != null) { 
     currentWindow?.apply { 
      width = config.double("w")!! 
      height = config.double("h")!! 
     } 
    } 

    currentWindow?.apply { 
     Bindings.add(widthProperty(), heightProperty()).onChange { 
      with (config) { 
       put("w", width.toString()) 
       put("h", height.toString()) 
       save() 
      } 
     } 
    } 
} 
関連する問題