Sha256: 8338445fca1b2ab1d19e8e427de582f26af75f14df9840ac9b31b86bd72291dd

Contents?: true

Size: 848 Bytes

Versions: 6

Compression:

Stored size: 848 Bytes

Contents

# Class which can supply icons and bitmaps
class Wx::ArtProvider
  # Keep a note of supplied ArtProviders to prevent them being GC'd
  @__art_provs = []

  class << self 
    wx_push_back = instance_method(:push_back)
    define_method(:push_back) do | art_prov |
      wx_push_back.bind(self).call(art_prov)
      @__art_provs.unshift(art_prov)
    end

    wx_pop = instance_method(:pop)
    define_method(:pop) do
      wx_pop.bind(self).call
      @__art_provs.pop
    end

    wx_push = instance_method(:push)
    define_method(:push) do | art_prov |
      wx_push.bind(self).call(art_prov)
      @__art_provs.push(art_prov)
    end

    wx_delete = instance_method(:delete)
    define_method(:delete) do | art_prov |
      wx_push.bind(self).call(art_prov)
      @__art_provs.delete(art_prov)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.beta.11-x64-mingw-ucrt lib/wx/core/artprovider.rb
wxruby3-0.9.0.pre.beta.10-x64-mingw-ucrt lib/wx/core/artprovider.rb
wxruby3-0.9.0.pre.beta.9-x64-mingw-ucrt lib/wx/core/artprovider.rb
wxruby3-0.9.0.pre.beta.8-x64-mingw-ucrt lib/wx/core/artprovider.rb
wxruby3-0.9.0.pre.beta.2-x64-mingw-ucrt-3.2-3.2.2 lib/wx/core/artprovider.rb
wxruby3-0.9.0.pre.beta.1-x64-mingw-ucrt-3.2 lib/wx/core/artprovider.rb