Sha256: 6ccb07615b37f779e11e92ce766094167c942861d6db9ce42827eb763a4045e1

Contents?: true

Size: 685 Bytes

Versions: 9

Compression:

Stored size: 685 Bytes

Contents

class Wx::Animation
  # 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 bitmap, 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, 
                      "Animation file does not exist: #{args[0]}" )
      end
      res = wx_init.bind(self).call()
      res.load_file(args[0], args[1] || Wx::ANIMATION_TYPE_ANY)
    else
      wx_init.bind(self).call(*args)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.rc.3 lib/wx/core/animation.rb
wxruby3-0.9.0.pre.rc.2 lib/wx/core/animation.rb
wxruby3-0.9.0.pre.rc.1 lib/wx/core/animation.rb
wxruby3-0.9.0.pre.beta.14 lib/wx/core/animation.rb
wxruby3-0.9.0.pre.beta.13 lib/wx/core/animation.rb
wxruby3-0.9.0.pre.beta.11 lib/wx/core/animation.rb
wxruby3-0.9.0.pre.beta.10 lib/wx/core/animation.rb
wxruby3-0.9.0.pre.beta.9 lib/wx/core/animation.rb
wxruby3-0.9.0.pre.beta.8 lib/wx/core/animation.rb