lib/glimmer/libui/editable_combobox_proxy.rb in glimmer-dsl-libui-0.0.5 vs lib/glimmer/libui/editable_combobox_proxy.rb in glimmer-dsl-libui-0.0.6
- old
+ new
@@ -25,11 +25,12 @@
module LibUI
# Proxy for LibUI editable combobox objects
#
# Follows the Proxy Design Pattern
class EditableComboboxProxy < ControlProxy
- def items(values = nil)
- if values.nil?
+ def items(*values)
+ values = values.first if values.first.is_a?(Array)
+ if values.empty?
@values
else
@values = values
@values.each { |value| append value }
end