### In Files

- wx/keyword_ctors.rb

### Namespace

- Module Wx::KeywordConstructor::ClassMethods

### Methods

- included
- new
- pre_wx_kwctor_init

### Files

- wxruby2.lib

### Class Index

Quicksearch

- Wx
- Wx::AcceleratorTable
- Wx::Animation
- Wx::App
- Wx::ArtProvider
- Wx::AuiNotebook
- Wx::Bitmap
- Wx::BusyCursor
- Wx::CheckListBox
- Wx::Choice
- Wx::ClientDC
- Wx::Clipboard
- Wx::Colour
- Wx::ComboBox
- Wx::CommandEvent
- Wx::ControlWithItems
- Wx::DC
- Wx::Event
- Wx::EvtHandler
- Wx::Font
- Wx::Grid
- Wx::HelpController
- Wx::HelpControllerHelpProvider
- Wx::HelpProvider
- Wx::HtmlHelpController
- Wx::HtmlWindow
- Wx::Icon
- Wx::IconBundle
- Wx::Image
- Wx::ImageList
- Wx::KeywordConstructor
- Wx::KeywordConstructor::ClassMethods
- Wx::ListBox
- Wx::ListCtrl
- Wx::Locale
- Wx::MediaCtrl
- Wx::Menu
- Wx::MenuItem
- Wx::Notebook
- Wx::Object
- Wx::PaintDC
- Wx::Point
- Wx::PreviewFrame
- Wx::Rect
- Wx::RichTextCtrl
- Wx::SimpleHelpProvider
- Wx::Size
- Wx::Sizer
- Wx::Sound
- Wx::StandardPaths
- Wx::TextCtrl
- Wx::TextUrlEvent
- Wx::Timer
- Wx::ToolBar
- Wx::ToolBarTool
- Wx::TreeCtrl
- Wx::Window
- Wx::XmlResource
- Rumix
- Rumix::Application
- Rumix::Config
- Rumix::Registry
- Rumix::Widget
- Rumix::Widget::CheckOptionPanel
- Rumix::Widget::OptionItem
- Rumix::Widget::OptionPanel
- Rumix::Widget::RadioOptionPanel
- Rumix::Widget::TitleText
- ROpt
- ROpt::ArgumentParser
- ROpt::ParseResult
- Uconv
- Uconv::Error
- Enumerable
- File
- Ini
- Kernel
- Module
- Object
- Pathname
- WxConstructor
- WxRubyStyleAccessors

No matching classes.

# Wx::KeywordConstructor

### Public Class Methods

included(klass) click to toggle source

(Not documented)

    # File wx/keyword_ctors.rb, line 149
        def self.included(klass)
          klass.extend ClassMethods
          klass.module_eval do

            alias :pre_wx_kwctor_init :initialize

            # The new definition of initialize; accepts a parent arg
            # mixed_args, which may zero or more position args, optionally
            # terminated with hash keyword args, and an optional block
            def initialize(parent = :default_ctor, *mixed_args, &block)
              # allow zero-args ctor for use with XRC
              if parent == :default_ctor
                pre_wx_kwctor_init()
                return
              end

              real_args = [ parent ] + self.class.args_as_list(*mixed_args)
              begin
                pre_wx_kwctor_init(*real_args)
              rescue => err
                msg = "Error initializing #{self.inspect}\n"+
                      " : #{err.message} \n" +
                      "Correct parameters for #{self.class.name}.new are:\n" +
                       self.class.describe_constructor()

                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

          # Any class inheriting from a class including this module must have
          # its own copy of the param_spec
          def klass.inherited(sub_klass)
            sub_klass.instance_variable_set(:@param_spec,
                                            instance_variable_get(:@param_spec) )
          end
        end

new(parent = :default_ctor, *mixed_args, &block) click to toggle source

The new definition of initialize; accepts a parent arg mixed_args, which may zero or more position args, optionally terminated with hash keyword args, and an optional block

    # File wx/keyword_ctors.rb, line 158
            def initialize(parent = :default_ctor, *mixed_args, &block)
              # allow zero-args ctor for use with XRC
              if parent == :default_ctor
                pre_wx_kwctor_init()
                return
              end

              real_args = [ parent ] + self.class.args_as_list(*mixed_args)
              begin
                pre_wx_kwctor_init(*real_args)
              rescue => err
                msg = "Error initializing #{self.inspect}\n"+
                      " : #{err.message} \n" +
                      "Correct parameters for #{self.class.name}.new are:\n" +
                       self.class.describe_constructor()

                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

Also aliased as: pre_wx_kwctor_init

### Public Instance Methods

pre_wx_kwctor_init(parent = :default_ctor, *mixed_args, &block) click to toggle source

Alias for initialize

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.