Sha256: 1c78e1c7b36ca228fd4435524d5f25d0452f7449d19afa8f066d1fc9237baba0

Contents?: true

Size: 904 Bytes

Versions: 14

Compression:

Stored size: 904 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

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

14 entries across 14 versions & 1 rubygems

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