This page is no longer maintained — Please continue to the home page at www.scala-lang.org

scala.swing.ComboBox bug

No replies
Rob Dickens
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.
 class ComboBox[A](items: Seq[A]) extends Component with Publisher {
!  object selection extends Publisher {
                    -----------------
     ...
+  }
     peer.addActionListener(Swing.ActionListener { e =>
     ...
-  }

That is, the peer.addActionListener should appear outside the body of the selection object (and in the body of the ComboBox class itself). Only then is the SelectionChanged event published (when you change the selection).

--
Rob, Lafros.com

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland