Class: Merrol::Commands
- Inherits:
-
Object
- Object
- Merrol::Commands
- Defined in:
- lib/merrol/lib/commands.rb
Instance Method Summary collapse
-
#initialize(window) ⇒ Commands
constructor
A new instance of Commands.
- #register(controller) ⇒ Object
Constructor Details
Instance Method Details
#register(controller) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/merrol/lib/commands.rb', line 9 def register controller @commands[controller.name.to_s].each do |command, detail| if detail['key'] =~ /TAB/ Gtk::Window.toplevels.first.signal_connect('key_press_event') do |, event| if detail['key'] == Shortcut.from(event) controller.send(command) else false end end else @accel_group.connect "<#{APP_NAME}>/#{controller.name}/#{command}" do controller.send(command) end end end end |