Skip to content

Commit adf3c18

Browse files
committed
fixes for control panel
1 parent da7122e commit adf3c18

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

library/control_panel/control_panel.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ def initialize(control_panel, name, proc = nil)
8282
set_preferred_size(java.awt.Dimension.new(170, 64))
8383
control_panel.add_element(self, name, false, true)
8484
add_action_listener do
85-
$app.send(name.to_s)
86-
proc.call(value) if proc
85+
$app.send(name)
86+
proc.call if proc
8787
end
8888
end
8989
end
@@ -150,10 +150,10 @@ def look_feel(lf)
150150

151151
def set_feel(lf = 'metal')
152152
lafinfo = javax.swing.UIManager.getInstalledLookAndFeels
153-
laf = lafinfo.select do |info|
154-
info.getName.eql? lf.capitalize
153+
laf = lafinfo.to_ary.select do |info|
154+
info.name =~ Regexp.new(Regexp.escape(lf), Regexp::IGNORECASE)
155155
end
156-
javax.swing.UIManager.setLookAndFeel(laf[0].getClassName)
156+
javax.swing.UIManager.setLookAndFeel(laf[0].class_name)
157157
end
158158
end
159159

@@ -168,4 +168,4 @@ def control_panel
168168
end
169169
end
170170

171-
Processing::App.send :include, ControlPanel::InstanceMethods
171+
Processing::App.include(ControlPanel::InstanceMethods)

0 commit comments

Comments
 (0)