lib/gtk3/dialog.rb in gtk3-3.4.3 vs lib/gtk3/dialog.rb in gtk3-3.4.4
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (C) 2015-2016 Ruby-GNOME2 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.
@@ -54,24 +54,23 @@
end
end
alias_method :add_button_raw, :add_button
def add_button(text, response_id)
- case response_id
- when Symbol
- response_id = ResponseType.new(response_id)
- end
- add_button_raw(text, response_id)
+ add_button_raw(text, ResponseType.resolve(response_id))
end
alias_method :get_widget_for_response_raw, :get_widget_for_response
def get_widget_for_response(response_id)
- case response_id
- when Symbol
- response_id = ResponseType.new(response_id)
- end
- get_widget_for_response_raw(response_id)
+ get_widget_for_response_raw(ResponseType.resolve(response_id))
end
+
+ alias_method :set_default_response_raw, :set_default_response
+ def set_default_response(response_id)
+ set_default_response_raw(ResponseType.resolve(response_id))
+ end
+ alias_method :default_response_raw=, :default_response=
+ alias_method :default_response=, :set_default_response
if method_defined?(:use_header_bar)
alias_method :use_header_bar_raw, :use_header_bar
undef_method :use_header_bar
def use_header_bar?