Sha256: 34a8c15d9ef652a9d839546aa6a99772074367c5ebcaa3cd10ae19f896ebf720

Contents?: true

Size: 884 Bytes

Versions: 7

Compression:

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

7 entries across 7 versions & 1 rubygems

Version Path
wxruby3-0.9.7-x64-mingw-ucrt lib/wx/html/htmlhelpcontroller.rb
wxruby3-0.9.5-x64-mingw-ucrt lib/wx/html/htmlhelpcontroller.rb
wxruby3-0.9.4-x64-mingw-ucrt lib/wx/html/htmlhelpcontroller.rb
wxruby3-0.9.3-x64-mingw-ucrt lib/wx/html/htmlhelpcontroller.rb
wxruby3-0.9.2-x64-mingw-ucrt lib/wx/html/htmlhelpcontroller.rb
wxruby3-0.9.1-x64-mingw-ucrt lib/wx/html/htmlhelpcontroller.rb
wxruby3-0.9.0-x64-mingw-ucrt lib/wx/html/htmlhelpcontroller.rb