Sha256: ad1766c5a73bc88cec74a357a9d13de86e0cb1167713d22930db58997f97428d

Contents?: true

Size: 662 Bytes

Versions: 6

Compression:

Stored size: 662 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 {
      grid_layout
      
      text 'Hello, List Single Selection!'
      
      list {
        selection bind(person, :country)
      }
      
      button {
        text "Reset Selection To Default Value"
        
        on_widget_selected { person.reset_country }
      }
    }.open
  end
end

HelloListSingleSelection.new.launch

Version data entries

6 entries across 6 versions & 1 rubygems

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