Sha256: b358faa183656899d0fa2a7b64971fca10ba9fdb815d6d2fb0f0f16592c5395d

Contents?: true

Size: 657 Bytes

Versions: 18

Compression:

Stored size: 657 Bytes

Contents

class Wx::Icon
  # Analogous to Image.from_bitmap
  def self.from_bitmap(bmp)
    ico = new
    ico.copy_from_bitmap(bmp)
    ico
  end

  # Redefine the initialize method so it raises an exception if a
  # non-existent file is given to the constructor; otherwise, wx Widgets
  # just carries on with an empty icon, which may cause faults later
  wx_init = self.instance_method(:initialize)
  define_method(:initialize) do | *args |
    if args[0].kind_of? String
      if not File.exist?( File.expand_path(args[0]) )
        Kernel.raise(ArgumentError, "Icon file does not exist: #{args[0]}")
      end
    end
    wx_init.bind(self).call(*args)
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
wxruby-1.9.7-i386-mswin32 lib/wx/classes/icon.rb
wxruby-1.9.6-universal-darwin-9 lib/wx/classes/icon.rb
wxruby-1.9.6-x86-linux lib/wx/classes/icon.rb
wxruby-1.9.6-x86-mingw32 lib/wx/classes/icon.rb
wxruby-1.9.6-x86-mswin32-60 lib/wx/classes/icon.rb
wxruby-1.9.7-universal-darwin-9 lib/wx/classes/icon.rb
wxruby-1.9.7-x86-linux lib/wx/classes/icon.rb
wxruby-1.9.7-x86-mswin32-60 lib/wx/classes/icon.rb
wxruby-1.9.8-universal-darwin-9 lib/wx/classes/icon.rb
wxruby-1.9.8-x86-mingw32 lib/wx/classes/icon.rb
wxruby-1.9.8-x86-linux lib/wx/classes/icon.rb
wxruby-1.9.8-x86-mswin32-60 lib/wx/classes/icon.rb
wxruby-1.9.8-x86_64-linux lib/wx/classes/icon.rb
wxruby-1.9.9-universal-darwin-9 lib/wx/classes/icon.rb
wxruby-1.9.9-x86-linux lib/wx/classes/icon.rb
wxruby-1.9.9-x86-mingw32 lib/wx/classes/icon.rb
wxruby-1.9.9-x86-mswin32-60 lib/wx/classes/icon.rb
wxruby-ruby19-1.9.8-x86-darwin-9 lib/wx/classes/icon.rb