lib/gtk3/widget.rb in gtk3-3.4.3 vs lib/gtk3/widget.rb in gtk3-3.4.4

- old
+ new

@@ -1,6 +1,6 @@ -# Copyright (C) 2015-2019 Ruby-GNOME Project Team +# Copyright (C) 2015-2020 Ruby-GNOME Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. @@ -79,9 +79,27 @@ set_events_raw(new_events.to_i) end alias_method :events_raw=, :events= alias_method :events=, :set_events + + alias_method :set_size_request_raw, :set_size_request + 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 alias_method :drag_source_set_raw, :drag_source_set def drag_source_set(flags, targets, actions) targets = ensure_drag_targets(targets) drag_source_set_raw(flags, targets, actions)