Sha256: d59e34c4befbe02cbac6775243c3fe8d01aca689ae83c047376bde548d4cd74b
Contents?: true
Size: 1.46 KB
Versions: 9
Compression:
Stored size: 1.46 KB
Contents
class Wx::SplashScreen # special handling for keyword ctor extension here # as this class deviates from 'normal' window ctors Wx::define_keyword_ctors(Wx::SplashScreen) do wx_ctor_params :id, :pos, :size, :style => Wx::SIMPLE_BORDER|Wx::FRAME_NO_TASKBAR|Wx::STAY_ON_TOP end # now redefine the overridden ctor to account for deviating arglist def initialize(bitmap, splashstyle, milliseconds, parent = nil, *mixed_args, &block) # no zero-args ctor for use with XRC! begin real_args = [ bitmap, splashstyle, milliseconds, parent ] + self.class.args_as_list(*mixed_args) pre_wx_kwctor_init(*real_args) rescue => err msg = "Error initializing #{self.inspect}\n"+ " : #{err.message} \n" + "Provided are #{real_args} \n" + "Correct parameters for #{self.class.name}.new are:\n" + self.class.describe_constructor( ":bitmap => Wx::Bitmap\n:splashstyle => Integer\n:milliseconds => Integer\n:parent => Wx::Window\n") new_err = err.class.new(msg) new_err.set_backtrace(caller) Kernel.raise new_err end # If a block was given, pass the newly created Window instance # into it; use block if block if block.arity == -1 or block.arity == 0 self.instance_eval(&block) elsif block.arity == 1 block.call(self) else Kernel.raise ArgumentError, "Block to initialize accepts zero or one arg" end end end end
Version data entries
9 entries across 9 versions & 1 rubygems