Sha256: c67ebaa06d3526a337e279e86afc2657b70149e56c830cc0574e7f8c936064e4

Contents?: true

Size: 603 Bytes

Versions: 9

Compression:

Stored size: 603 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

9 entries across 9 versions & 1 rubygems

Version Path
glimmer-dsl-opal-0.7.5 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.7.4 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.7.3 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.7.2 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.7.1 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.7.0 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.6.1 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.6.0 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb
glimmer-dsl-opal-0.5.1 lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb