Files

Wx::SimpleHelpProvider

Pure-ruby implementation of the corresponding Wx class. Simply shows the Window’s help text in a tooltip.

Public Class Methods

new() click to toggle source

(Not documented)

# File wx/classes/simplehelpprovider.rb, line 4
  def initialize
    super
    # Store for mapping windows -> help strings
    @help_wins = {} 
    # Store for mapping ids -> help strings
    @help_ids  = {}
  end

Public Instance Methods

add_help(identifier, text) click to toggle source

This is what is called by Wx::Window#set_help_text

# File wx/classes/simplehelpprovider.rb, line 13
  def add_help(identifier, text)
    if identifier.kind_of? Wx::Window
      @help_wins[identifier.object_id] = text
    else
      @help_ids[identifier] = text
    end
  end
get_help(win) click to toggle source

Retrieve help text for the given window win

# File wx/classes/simplehelpprovider.rb, line 22
  def get_help(win)
    @help_wins[win.object_id] || @help_ids[win.wx_id] || ""
  end
remove_help(win) click to toggle source

Remove the help text for win

# File wx/classes/simplehelpprovider.rb, line 27
  def remove_help(win)
    @help_wins.delete(win.object_id)
  end
show_help(win) click to toggle source

Show help for win

# File wx/classes/simplehelpprovider.rb, line 32
  def show_help(win)
    help_text = get_help(win)
    return false if help_text.empty?
    tip = Wx::TipWindow.new(win, help_text, 100)
    true
  end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.