Sha256: a1915c02eaf2f1550243d6e091d8f4f54bc23df6fa6b435e64eebea8863a9058

Contents?: true

Size: 540 Bytes

Versions: 24

Compression:

Stored size: 540 Bytes

Contents

class Wx::Image
  # 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 invalid image, 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, "Image file does not exist: #{args[0]}")
      end
    end
    wx_init.bind(self).call(*args)
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
wxruby-1.9.5-i386-mswin32 lib/wx/classes/image.rb
wxruby-1.9.4-i386-mswin32 lib/wx/classes/image.rb
wxruby-1.9.3-i386-mswin32 lib/wx/classes/image.rb
wxruby-1.9.2-powerpc-darwin8.10.0 lib/wx/classes/image.rb
wxruby-1.9.2-i686-linux lib/wx/classes/image.rb
wxruby-1.9.2-i686-darwin8.8.2 lib/wx/classes/image.rb
wxruby-1.9.2-i386-mswin32 lib/wx/classes/image.rb
wxruby-1.9.1-powerpc-darwin8.3.0 lib/wx/classes/image.rb
wxruby-1.9.1-i686-linux lib/wx/classes/image.rb
wxruby-1.9.1-i686-darwin8.4.1 lib/wx/classes/image.rb
wxruby-1.9.1-i386-mswin32 lib/wx/classes/image.rb
wxruby-1.9.0-powerpc-darwin8.10.0 lib/wx/classes/image.rb
wxruby-1.9.0-i686-linux lib/wx/classes/image.rb
wxruby-1.9.0-i686-darwin8.4.1 lib/wx/classes/image.rb
wxruby-1.9.0-i386-mswin32 lib/wx/classes/image.rb
wxruby-1.9.1-x86_64-linux lib/wx/classes/image.rb
wxruby-1.9.2-x86_64-linux lib/wx/classes/image.rb
wxruby-1.9.3-universal-darwin lib/wx/classes/image.rb
wxruby-1.9.3-x86-linux lib/wx/classes/image.rb
wxruby-1.9.4-x86_64-linux lib/wx/classes/image.rb