Sha256: 0c5d8fe244f7f4865842e0bda0c33a507edefd735c429347f77671f077167453

Contents?: true

Size: 1.04 KB

Versions: 16

Compression:

Stored size: 1.04 KB

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.

###
# wxRuby3 wxWidgets interface director
###

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.do_not_generate(:variables, :enums, :defines, :functions)
      end
    end # class WindowDisabler

  end # class Director

end # module WXRuby3

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
wxruby3-1.3.1 rakelib/lib/director/window_disabler.rb
wxruby3-1.3.0 rakelib/lib/director/window_disabler.rb
wxruby3-1.2.1 rakelib/lib/director/window_disabler.rb
wxruby3-1.2.0 rakelib/lib/director/window_disabler.rb
wxruby3-1.1.2 rakelib/lib/director/window_disabler.rb
wxruby3-1.1.1 rakelib/lib/director/window_disabler.rb
wxruby3-1.1.0 rakelib/lib/director/window_disabler.rb
wxruby3-1.0.1 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.8 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.7 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.5 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.4 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.3 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.2 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.1 rakelib/lib/director/window_disabler.rb
wxruby3-0.9.0 rakelib/lib/director/window_disabler.rb