Sha256: 5df484ac3876946a2383066a0fdb0a3b95ed369466205ec9fd813d8e4c775297

Contents?: true

Size: 1.62 KB

Versions: 186

Compression:

Stored size: 1.62 KB

Contents

# Copyright (C) 2015  Ruby-GNOME2 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.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

module Gtk
  class TreeModelFilter
    def initialize(child_model, root=nil)
      super(:child_model => child_model, :virtual_root => root)
    end

    alias_method :set_modify_func_raw, :set_modify_func
    def set_modify_func(*types, &block)
      raise ArgumentError, "one or more types are required" if types.empty?
      set_modify_func_raw(types, &block)
    end

    alias_method :convert_iter_to_child_iter_raw, :convert_iter_to_child_iter
    def convert_iter_to_child_iter(iter)
      child_iter = convert_iter_to_child_iter_raw(iter)
      child_iter.model = model
      child_iter
    end

    alias_method :convert_child_iter_to_iter_raw, :convert_child_iter_to_iter
    def convert_child_iter_to_iter(child_iter)
      converted, iter = convert_child_iter_to_iter_raw(child_iter)
      return nil unless converted

      iter.model = self
      iter
    end
  end
end

Version data entries

186 entries across 178 versions & 3 rubygems

Version Path
gtk4-4.2.5 lib/gtk4/tree-model-filter.rb
gtk3-4.2.5 lib/gtk3/tree-model-filter.rb
gtk4-4.2.4 lib/gtk4/tree-model-filter.rb
gtk3-4.2.4 lib/gtk3/tree-model-filter.rb
gtk4-4.2.3 lib/gtk4/tree-model-filter.rb
gtk3-4.2.3 lib/gtk3/tree-model-filter.rb
gtk4-4.2.2 lib/gtk4/tree-model-filter.rb
gtk3-4.2.2 lib/gtk3/tree-model-filter.rb
gtk4-4.2.1 lib/gtk4/tree-model-filter.rb
gtk3-4.2.1 lib/gtk3/tree-model-filter.rb
gtk4-4.2.0 lib/gtk4/tree-model-filter.rb
gtk3-4.2.0 lib/gtk3/tree-model-filter.rb
gtk4-4.1.9 lib/gtk4/tree-model-filter.rb
gtk3-4.1.9 lib/gtk3/tree-model-filter.rb
gtk4-4.1.8 lib/gtk4/tree-model-filter.rb
gtk3-4.1.8 lib/gtk3/tree-model-filter.rb
gtk4-4.1.7 lib/gtk4/tree-model-filter.rb
gtk3-4.1.7 lib/gtk3/tree-model-filter.rb
gtk4-4.1.6 lib/gtk4/tree-model-filter.rb
gtk3-4.1.6 lib/gtk3/tree-model-filter.rb