Class: Java::OrgEclipseSwtWidgets::Composite

Inherits:
Object
  • Object
show all
Defined in:
lib/sweet/composite.rb

Instance Method Summary collapse

Instance Method Details

#layout=(name, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/sweet/composite.rb', line 3

def layout=(name, options = {})
  class_name = "#{name.to_s.capitalize}Layout"
  l = instance_eval "org.eclipse.swt.layout.#{class_name}.new"

  options.each_pair do |k,v|
    l.send("#{k}=", v)
  end

  setLayout l
end