Sha256: 0502fb43e3ca98f6818ac707dc4757e05104dce259f4d28d6ba8c2cef377fd4f

Contents?: true

Size: 590 Bytes

Versions: 9

Compression:

Stored size: 590 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 HelloCombo
  include Glimmer
  def launch
    person = Person.new
    shell {
      composite {
        combo(:read_only) {
          selection bind(person, :country)
        }
        button {
          text "Reset"
          on_widget_selected do
            person.reset_country
          end
        }
      }
    }.open
  end
end

HelloCombo.new.launch

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
glimmer-dsl-opal-0.1.0 lib/samples/hello/hello_combo.rb
glimmer-dsl-opal-0.0.9 lib/samples/hello/hello_combo.rb
glimmer-dsl-opal-0.0.8 lib/samples/hello/hello_combo.rb
glimmer-dsl-opal-0.0.7 lib/samples/hello/hello_combo.rb
glimmer-dsl-opal-0.0.6 lib/samples/hello/hello_combo.rb
glimmer-dsl-opal-0.0.5 lib/samples/hello/hello_combo.rb
glimmer-dsl-opal-0.0.4 lib/samples/hello/hello_combo.rb
glimmer-dsl-opal-0.0.3 lib/samples/hello/hello_combo.rb
glimmer-dsl-opal-0.0.2 lib/samples/hello/hello_combo.rb