Class: Wx::SimpleHelpProvider
- Inherits:
-
HelpProvider
- Object
- HelpProvider
- Wx::SimpleHelpProvider
- Defined in:
- lib/wx/classes/simplehelpprovider.rb
Overview
Pure-ruby implementation of the corresponding Wx class. Simply shows the Window’s help text in a tooltip.
Direct Known Subclasses
Instance Method Summary collapse
-
#add_help(identifier, text) ⇒ Object
This is what is called by Wx::Window#set_help_text.
-
#get_help(win) ⇒ Object
Retrieve help text for the given window
win
. -
#initialize ⇒ SimpleHelpProvider
constructor
A new instance of SimpleHelpProvider.
-
#remove_help(win) ⇒ Object
Remove the help text for
win
. -
#show_help(win) ⇒ Object
Show help for
win
.
Constructor Details
#initialize ⇒ SimpleHelpProvider
Returns a new instance of SimpleHelpProvider.
4 5 6 7 8 9 10 |
# File 'lib/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 |
Instance Method Details
#add_help(identifier, text) ⇒ Object
This is what is called by Wx::Window#set_help_text
13 14 15 16 17 18 19 |
# File 'lib/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) ⇒ Object
Retrieve help text for the given window win
22 23 24 |
# File 'lib/wx/classes/simplehelpprovider.rb', line 22 def get_help(win) @help_wins[win.object_id] || @help_ids[win.wx_id] || "" end |
#remove_help(win) ⇒ Object
Remove the help text for win
27 28 29 |
# File 'lib/wx/classes/simplehelpprovider.rb', line 27 def remove_help(win) @help_wins.delete(win.object_id) end |