I'm trying to catch a mouse-click even on a Table
(which should cause a popup to be shown). The table is inside a ScrollPane
which is (in turn) inside a Panel
. I have added reactions to all the classes, but I can never seem to actually get a click event to be caught!
class MyPanel extends GridBagPanel {
val gbc = new GridBagContraints( ... )
add(new ScrollPane {
reactions += {
case MouseClicked(src, point, mod, clicks, pops) =>
println("Scroll pops: " + pops)
}
viewportView = new Table {
reactions += {
case MouseClicked(src, point, mod, clicks, pops) =>
println("Table pops: " + pops)
}
...
}
}, gbc)
reactions += {
case MouseClicked(src, point, mod, clicks, pops) =>
println("Panel pops: " + pops)
}
}
No matter where I click, nothing gets printed. What am I doing wrong?