lib/swing/button.rb in swing-0.0.2 vs lib/swing/button.rb in swing-0.0.3

- old
+ new

@@ -1,22 +1,19 @@ require 'swing/action_listener' require 'swing/attr_setter' -module Clients - module Swing +module Swing - class Button < javax.swing.JButton - include AttrSetter + class Button < javax.swing.JButton + include AttrSetter - attr_setter :enabled + attr_setter :enabled - def initialize text, opts = {}, &block - set_attributes(opts) { super(text) } + def initialize text, opts = {}, &block + set_attributes(opts) { super(text) } - self.addActionListener ActionListener.new &block + self.addActionListener ActionListener.new &block - opts[:parent].add self if opts[:parent] - end - end # class Button - - end + opts[:parent].add self if opts[:parent] + end + end # class Button end