I have two views that I inject as properties into ...
# tornadofx
d
I have two views that I inject as properties into another view
Copy code
private val accountView: AccountView by inject()
    private val dataView: DataView by inject()
The parent view that these are injected to has a root of gridpane. I add the views in this way to the pane:
Copy code
with(root) {
  useMaxWidth = true
  hgrow = Priority.ALWAYS
  constraintsForColumn(0).apply {
    hgrow = Priority.ALWAYS
  }
  constraintsForColumn(1).apply {
    hgrow = Priority.ALWAYS
  }
  add(accountView.apply {
    gridpaneConstraints {
      columnRowIndex(0, 0)
    }
  })
  add(dataView.apply {
    gridpaneConstraints {
      columnRowIndex(1, 0)
    }
  })
}
What ends up happening is that the views are displayed stacked on one another and do not abide the column constraint the way I expected (each column taking up half the pane). The only way I have gotten it to work the way I expect is via adding a row builder surrounding the add(view)'s. Is there something I am doing obviously wrong?