require_relative "../lib/glimmer" class Person attr_accessor :country, :country_options def initialize self.country_options=["", "Canada", "US", "Mexico"] self.country = "Canada" end def reset_country self.country = "Canada" end end class HelloListSingleSelection include Glimmer def launch person = Person.new shell { composite { list { selection bind(person, :country) } button { text "Reset" on_widget_selected do person.reset_country end } } }.open end end HelloListSingleSelection.new.launch