Sha256: 5d73e52b82c7be5da5114dfc6fdf5c9fc1b3b66fd782b30469a2475892935f57

Contents?: true

Size: 852 Bytes

Versions: 3

Compression:

Stored size: 852 Bytes

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.

class Wx::RBN::RibbonGallery

  def item_client_data_store
    @item_client_data ||= {}
  end
  private :item_client_data_store

  def set_item_client_data(item, data)
    item_client_data_store[item] = data
  end

  def get_item_client_data(item)
    item_client_data_store[item]
  end
  alias :item_client_data :get_item_client_data

  wx_append = instance_method :append
  define_method :append do |bmp, item_id, data=nil|
    item = wx_append.bind(self).call(bmp, item_id)
    set_item_client_data(item, data) if item && data
    item
  end

  def items
    if block_given?
      count.times { |i| yield item(i) }
    else
      ::Enumerator.new { |y| count.times { |i| y << item(i) } }
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wxruby3-0.9.2-x64-mingw-ucrt lib/wx/rbn/ribbon_gallery.rb
wxruby3-0.9.1-x64-mingw-ucrt lib/wx/rbn/ribbon_gallery.rb
wxruby3-0.9.0-x64-mingw-ucrt lib/wx/rbn/ribbon_gallery.rb