Sha256: b896f2d21ea669fb1cfeba6d2fc3c6d99e27e0fc51c8ac6273ce1f60db6c3ad2

Contents?: true

Size: 1.01 KB

Versions: 16

Compression:

Stored size: 1.01 KB

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.
# 
# Some parts are
# Copyright 2004-2007, wxRuby development team
# released under the MIT-like wxRuby2 license

# 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.push(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.unshift(art_prov)
    end

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
wxruby3-1.3.1 lib/wx/core/artprovider.rb
wxruby3-1.3.0 lib/wx/core/artprovider.rb
wxruby3-1.2.1 lib/wx/core/artprovider.rb
wxruby3-1.2.0 lib/wx/core/artprovider.rb
wxruby3-1.1.2 lib/wx/core/artprovider.rb
wxruby3-1.1.1 lib/wx/core/artprovider.rb
wxruby3-1.1.0 lib/wx/core/artprovider.rb
wxruby3-1.0.1 lib/wx/core/artprovider.rb
wxruby3-0.9.8 lib/wx/core/artprovider.rb
wxruby3-0.9.7 lib/wx/core/artprovider.rb
wxruby3-0.9.5 lib/wx/core/artprovider.rb
wxruby3-0.9.4 lib/wx/core/artprovider.rb
wxruby3-0.9.3 lib/wx/core/artprovider.rb
wxruby3-0.9.2 lib/wx/core/artprovider.rb
wxruby3-0.9.1 lib/wx/core/artprovider.rb
wxruby3-0.9.0 lib/wx/core/artprovider.rb