Sha256: 9795b7b6e92338dbbb1ee9d0c5807d4739eddfb8fcb4f7a9e8f003888fe7335f

Contents?: true

Size: 604 Bytes

Versions: 13

Compression:

Stored size: 604 Bytes

Contents

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
glimmer-dsl-opal-0.5.0 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.4.0 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.3.0 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.2.0 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.1.0 lib/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.0.9 lib/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.0.8 lib/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.0.7 lib/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.0.6 lib/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.0.5 lib/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.0.4 lib/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.0.3 lib/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.0.2 lib/samples/hello/hello_list_single_selection.rb