lib/gtk3/widget.rb in gtk3-3.5.1 vs lib/gtk3/widget.rb in gtk3-4.0.0

- old
+ new

@@ -1,6 +1,6 @@ -# Copyright (C) 2015-2020 Ruby-GNOME Project Team +# Copyright (C) 2015-2022 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. @@ -15,13 +15,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gtk class Widget class << self - def init - end - def have_template? @have_template ||= false end def template_children @@ -142,11 +139,22 @@ alias_method :style_context_raw, :style_context def style_context @style_context ||= style_context_raw end + alias_method :insert_action_group_raw, :insert_action_group + def insert_action_group(name, group) + insert_action_group_raw(name, group) + @action_groups ||= {} + if group.nil? + @action_groups.delete(name) + else + @action_groups[name] = group + end + end + private - def initialize_post + def initialize_template klass = self.class return unless klass.have_template? return unless respond_to?(:init_template) init_template