Sha256: d111a49d72bb4bb5d920d4b30d9d37c05aa013db6a789987eddadfeca034f9f7

Contents?: true

Size: 637 Bytes

Versions: 6

Compression:

Stored size: 637 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 {
      fill_layout :vertical
      text 'Hello, Combo!'
      
      combo(:read_only) {
        selection bind(person, :country)
      }
      
      button {
        text "Reset Selection"
        
        on_widget_selected do
          person.reset_country
        end
      }
    }.open
  end
end

HelloCombo.new.launch

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
glimmer-dsl-swt-0.6.9 samples/hello/hello_combo.rb
glimmer-dsl-swt-0.6.8 samples/hello/hello_combo.rb
glimmer-dsl-swt-0.6.7 samples/hello/hello_combo.rb
glimmer-dsl-swt-0.6.6 samples/hello/hello_combo.rb
glimmer-dsl-swt-0.6.5 samples/hello/hello_combo.rb
glimmer-dsl-swt-0.6.4 samples/hello/hello_combo.rb