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

- old
+ new

@@ -1,33 +1,28 @@ require 'swing/attr_setter' import javax.swing.JFrame -module Clients +module Swing - # Swing-based GUI controls - module Swing + class Frame < JFrame + include AttrSetter - class Frame < JFrame - include AttrSetter + attr_setter :layout, :background, :size, :title, + :default_close_operation => JFrame::EXIT_ON_CLOSE #DISPOSE_ON_CLOSE, HIDE_ON_CLOSE - attr_setter :layout, :background, :size, :title, - :default_close_operation => JFrame::EXIT_ON_CLOSE #DISPOSE_ON_CLOSE, HIDE_ON_CLOSE + def initialize name, opts = {} - def initialize name, opts = {} + set_attributes(opts) { super(name) } - set_attributes(opts) { super(name) } + setup opts - setup opts + self.location_relative_to = nil + self.visible = true + end - self.location_relative_to = nil - self.visible = true - end - - # Method that subclasses should override to set up their contents before - # Frame is made visible - def setup opts - end + # Method that subclasses should override to set up their contents before + # Frame is made visible + def setup opts end end end -