Class: Wx::AcceleratorTable
- Defined in:
- lib/wx/doc/gen/accelerator.rb
Overview
An accelerator table allows the application to specify a table of keyboard shortcuts for menu or button commands.
The object NULL_ACCELERATOR_TABLE is defined to be a table with no data, and is the initial accelerator table for a window. Example:
entries = [
Wx::AcceleratorEntry.new(Wx::ACCEL_CTRL, 'N', ID_NEW_WINDOW),
Wx::AcceleratorEntry.new(Wx::ACCEL_CTRL, 'X', Wx::ID_EXIT),
Wx::AcceleratorEntry.new(Wx::ACCEL_CTRL, 'A', Wx::ID_ABOUT),
Wx::AcceleratorEntry.new(Wx::ACCEL_CTRL, 'N', Wx::ID_CUT)
]
frame.accelerator_table = Wx::AcceleratorTable[entries]
An accelerator takes precedence over normal processing and can be a convenient way to program some event handling. For example, you can use an accelerator table to enable a dialog with a multi-line text control to accept CTRL-Enter as meaning 'OK'.
Category: Data Structures Predefined objects/pointers: NULL_ACCELERATOR_TABLE
Instance Method Summary collapse
-
#initialize(*args) ⇒ AcceleratorTable
constructor
A new instance of AcceleratorTable.
-
#is_ok ⇒ Boolean
(also: #ok?)
Returns true if the accelerator table is valid.
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize ⇒ Wx::AcceleratorTable #initialize(entries) ⇒ Wx::AcceleratorTable #initialize(resource) ⇒ Wx::AcceleratorTable
Returns a new instance of AcceleratorTable.
171 |
# File 'lib/wx/doc/gen/accelerator.rb', line 171 def initialize(*args) end |
Instance Method Details
#is_ok ⇒ Boolean Also known as: ok?
Returns true if the accelerator table is valid.
175 |
# File 'lib/wx/doc/gen/accelerator.rb', line 175 def is_ok; end |