Sha256: 9b2dbd79bd49ad7d58c93fdfcf1bd9e90c84d7585f73c64f3fe6df0e9b3bf042

Contents?: true

Size: 805 Bytes

Versions: 67

Compression:

Stored size: 805 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_insert = instance_method(:insert)
    define_method(:insert) do | art_prov |
      wx_insert.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_remove = instance_method(:remove)
    define_method(:remove) do | art_prov |
      wx_push.bind(self).call(art_prov)
      @__art_provs.delete(art_prov)
    end
  end
end

Version data entries

67 entries across 67 versions & 3 rubygems

Version Path
wxruby64-2.0.1-x64-mingw32 lib/wx/classes/artprovider.rb
wxruby-ruby19-2.0.1-x86-mingw32 lib/wx/classes/artprovider.rb
wxruby-ruby19-2.0.1-x86-linux lib/wx/classes/artprovider.rb
wxruby-ruby19-2.0.1-x86-darwin-9 lib/wx/classes/artprovider.rb
wxruby-2.0.1-x86-mswin32-60 lib/wx/classes/artprovider.rb
wxruby-2.0.1-x86-mingw32 lib/wx/classes/artprovider.rb
wxruby-2.0.1-x86-linux lib/wx/classes/artprovider.rb
wxruby-2.0.1-universal-darwin-9 lib/wx/classes/artprovider.rb
wxruby-1.9.7-i386-mswin32 lib/wx/classes/artprovider.rb
wxruby-1.9.5-i386-mswin32 lib/wx/classes/artprovider.rb
wxruby-1.9.4-i386-mswin32 lib/wx/classes/artprovider.rb
wxruby-1.9.3-i386-mswin32 lib/wx/classes/artprovider.rb
wxruby-1.9.2-powerpc-darwin8.10.0 lib/wx/classes/artprovider.rb
wxruby-1.9.2-i686-linux lib/wx/classes/artprovider.rb
wxruby-1.9.2-i686-darwin8.8.2 lib/wx/classes/artprovider.rb
wxruby-1.9.2-i386-mswin32 lib/wx/classes/artprovider.rb
wxruby-1.9.1-powerpc-darwin8.3.0 lib/wx/classes/artprovider.rb
wxruby-1.9.1-i686-linux lib/wx/classes/artprovider.rb
wxruby-1.9.1-i686-darwin8.4.1 lib/wx/classes/artprovider.rb
wxruby-1.9.1-i386-mswin32 lib/wx/classes/artprovider.rb