Sha256: 0a293b0d9d2e754f3b06fc640baac224a9f1008520568f3e8844f277377ff2bf

Contents?: true

Size: 936 Bytes

Versions: 3

Compression:

Stored size: 936 Bytes

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

module Wx

  class BitmapComboBox < Wx::ComboBox

    wx_append = instance_method :append
    wx_redefine_method :append do |item, *rest| #bitmap=Wx::NULL_BITMAP, data=nil|
      if ::Array === item
        super(item, *rest)
      elsif rest.empty? || Wx::Bitmap === rest.first
        wx_append.bind(self).call(item, *rest)
      else
        super(item, *rest)
      end
    end

    wx_insert = instance_method :insert
    wx_redefine_method :insert do |item, *rest| # bitmap, pos, data=nil|
      if ::Array === item
        super(item, *rest)
      elsif rest.empty? || Wx::Bitmap === rest.first
        wx_insert.bind(self).call(item, *rest)
      else
        super(item, *rest)
      end
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wxruby3-1.4.2 lib/wx/core/bitmap_combobox.rb
wxruby3-1.4.1 lib/wx/core/bitmap_combobox.rb
wxruby3-1.4.0 lib/wx/core/bitmap_combobox.rb