Sha256: b9b3d4b61ac655e72ad3f0de4d4bea9eedd9eacc9da2d5e7311378f8945cc70b

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

###
# wxRuby3 wxWidgets interface director
# Copyright (c) M.J.N. Corino, The Netherlands
###

module WXRuby3

  class Director

    class WindowDisabler < Director

      def setup
        super
        spec.disable_proxies
        # scope delimited guard constructs do not work in Ruby
        # so we'll have to use a block approach to Rubify
        # remove ctor (essentially make this a namespace/module instead of class)
        spec.ignore 'wxWindowDisabler::wxWindowDisabler'
        # add Ruby-style static method
        spec.add_extend_code 'wxWindowDisabler', <<~__HEREDOC
          static void disable(wxWindow *to_skip = NULL)
          {
            if (rb_block_given_p())
            {
              wxWindowDisabler disabler(to_skip);
              rb_yield(Qnil);
            }
            return ;
          }
          __HEREDOC
        spec.ignore %w[
          wxFindWindowByLabel
          wxFindWindowByName
          wxNewId
          wxUsleep
          ]
        spec.ignore 'wxPostDelete' unless Config.instance.wx_version >= '3.3.0'
        spec.do_not_generate(:variables, :enums, :defines, :functions)
      end
    end # class WindowDisabler

  end # class Director

end # module WXRuby3

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.beta.11 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.0.pre.beta.10 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.0.pre.beta.9 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.0.pre.beta.8 rakelib/lib/director/window_disabler.rb