Sha256: 9c95313c802ad11f792109087da7fd04c174e6177b21cff0adf42a7b235a6897

Contents?: true

Size: 852 Bytes

Versions: 16

Compression:

Stored size: 852 Bytes

Contents

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

module Wx

  module HTML

    class HtmlHelpController

      def self.instance(*args)
        @instance ||= new(*args)
      end

      # cache any explicitly assigned config for GC protection
      wx_use_config = instance_method(:use_config)
      define_method :use_config do |cfg, *args|
        @configuration = cfg
        if get_help_window
          # also set config var for any associated help window (as wxWidgets propagates it too)
          # so the instance remains GC protected whether or not the help window is destructed before
          # or after the controller
          get_help_window.instance_variable_set('@configuration', cfg)
        end
        wx_use_config.bind(self).call(cfg, *args)
      end

    end

  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

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