Skip to content

Commit

Permalink
added layout_manager as optional value.
Browse files Browse the repository at this point in the history
default value is nil.
  • Loading branch information
wsmirnow committed Oct 8, 2008
1 parent 4375a59 commit 92d2b71
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/rswing/components/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ def add(component, options = {})
self.add_to_content_pane(component, options)
else
# this should be handled somehow later on:
# if(layout = Options.value_for(options => :layout))
# super(component, layout)
# else
if(layout = Options.value_for(options => :layout))
super(component, layout)
else
super(component)
# end
end
end

# if :name given, add with name
Expand Down
1 change: 1 addition & 0 deletions lib/rswing/components/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def self.gui_options
:icon => nil,
:belongs_to => nil,
:layout => nil,
:layout_manager => nil,
:title => nil,
:name => nil,
:font => nil,
Expand Down
4 changes: 2 additions & 2 deletions lib/rswing/components/panel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class Panel < JPanel
include Events::MouseEvents
include Events::FocusEvents

def initialize(layout_manager, options = {}, &block)
super(layout_manager, Options.value_for(options => :double_buffer))
def initialize(options = {}, &block)
super(Options.value_for(options => :layout_manager), Options.value_for(options => :double_buffer))

if (border_title = Options.value_for(options => :title))
border = BorderFactory.createTitledBorder(border_title)
Expand Down

0 comments on commit 92d2b71

Please sign in to comment.