86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
# File 'lib/gtk3/widget.rb', line 86
def set_size_request(*args)
case args.size
when 1
options = args[0]
raise ArgumentError, ":width is missing" unless options.key?(:width)
width = options[:width]
raise ArgumentError, ":height is missing" unless options.key?(:height)
height = options[:height]
when 2
width, height = args
else
message = "wrong number of arguments (given #{args.size}, expected 1..2)"
raise ArgumentError, message
end
set_size_request_raw(width, height)
end
|