hello, how can I handle a situation, where a filed listens to a buttons that is not declared yet?
val detail = new BoxPanel(Orientation.Vertical){
listenTo(button)
}
val seznam = new BoxPanel(Orientation.Vertical){
val button = new Button("But"){
reactions += {
case ButtonClicked(_) =>
detail.contents.clear
detail.contents += new Label("Anystring")
}
}
I can't declare seznam
first either, because it reference the field detail
. So how can I write this?