Created
June 5, 2013 14:48
-
-
Save Sciss/5714412 to your computer and use it in GitHub Desktop.
ComboBox has no proper docs. Everytime I use it, I forget how to put the correct reactions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.swing._ | |
new Frame { | |
contents = new ComboBox(Seq("one", "two")) { | |
listenTo(selection) | |
reactions += { | |
case event.SelectionChanged(_) => println(selection.item) | |
} | |
} | |
pack() | |
centerOnScreen() | |
open() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment