Skip to content

Instantly share code, notes, and snippets.

@Sciss
Created June 5, 2013 14:48
Show Gist options
  • Save Sciss/5714412 to your computer and use it in GitHub Desktop.
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.
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