Sha256: 821ccf1679d88afc0922e7f41b59e96e36db3c5db2145dcf98c8880df86160df

Contents?: true

Size: 1.5 KB

Versions: 11

Compression:

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

11 entries across 11 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.rc.3-x64-mingw-ucrt lib/wx/core/splash_screen.rb
wxruby3-0.9.0.pre.rc.2-x64-mingw-ucrt lib/wx/core/splash_screen.rb
wxruby3-0.9.0.pre.rc.1-x64-mingw-ucrt lib/wx/core/splash_screen.rb
wxruby3-0.9.0.pre.beta.14-x64-mingw-ucrt lib/wx/core/splash_screen.rb
wxruby3-0.9.0.pre.beta.13-x64-mingw-ucrt lib/wx/core/splash_screen.rb
wxruby3-0.9.0.pre.beta.11-x64-mingw-ucrt lib/wx/core/splash_screen.rb
wxruby3-0.9.0.pre.beta.10-x64-mingw-ucrt lib/wx/core/splash_screen.rb
wxruby3-0.9.0.pre.beta.9-x64-mingw-ucrt lib/wx/core/splash_screen.rb
wxruby3-0.9.0.pre.beta.8-x64-mingw-ucrt lib/wx/core/splash_screen.rb
wxruby3-0.9.0.pre.beta.2-x64-mingw-ucrt-3.2-3.2.2 lib/wx/core/splash_screen.rb
wxruby3-0.9.0.pre.beta.1-x64-mingw-ucrt-3.2 lib/wx/core/splash_screen.rb